我正在使用 Selenium WebDriver (v2.5.0)。当我使用 driver.click(...)
"命令时出现此错误
Element is not currently visible and so may not be interacted with Build info: version: '2.5.0', revision: '13516', time: '2011-08-23 18:30:44' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-10-generic', java.version: '1.6.0_26' Driver info: driver.version: RemoteWebDriver
在浏览器中,当我将鼠标悬停在某个元素上时,被单击的元素变得可见。有没有办法检查某些东西是否可见?
最佳答案
您可以通过操作来做到这一点。实现你想要的,使用Python Webdriver客户端,但是原理是一样的。
ActionChains(driver).move_to_element(driver.find_element(By.ID, 'Foo'))\
.click(driver.find_element(By.Name, "Bar"))\
.perform()
关于Selenium:如何让 WebDriver 忽略 "Element is not visible"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7340680/