我有一个下拉列表,它在加载时被隐藏,点击按钮它被设置为可见,当selenium在浏览器中运行时我可以看到它,但它仍然给我这个例外
org.openqa.selenium.WebDriverException: ElementNotVisibleError: Element is not currently visible and may not be manipulated'ElementNotVisibleError: Element is not currently visible and may not be manipulated' when calling method: [wdIMouse::click] Command duration or timeout: 47 milliseconds
有人可以建议我们如何解决这个问题吗?
答案 0 :(得分:-1)
尝试使用Actions
和WebDriverWait
也许是这样的
Actions builder = new Actions(driver);
WebDriverWait wait = new WebDriverWait(driver);
Action clickTheDropDown = builder.moveToElement(dd).Click(otherElement).build();
clickTheDropDown.perform();
wait.Until(Expectedcondition.VisibilityOfElement(dd);