我听说Selenium 2.0 . 正在等待元素或页面默认加载,因此在调用click方法后不再需要编写像'waitForElementToLoad'这样的特定方法 .
这是真的吗?如果是,为什么't I find it anywhere in documentation? I constantly find some posts like this, where it'只能提到:Selenium - don't wait until all elements are presented
请建议我在哪里可以找到任何证据,等待加载元素的方法,以及从哪个版本实现?
我正在使用Selenium 2.0和Chrome驱动程序 .
谢谢 .
1 回答
与文档(http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp)中一样:
“隐式等待是告诉WebDriver在尝试查找一个或多个元素时,如果它们不能立即可用,则在一定时间内轮询DOM . The default setting is 0 . 一旦设置,就会为WebDriver对象的生命周期设置隐式等待实例“ .
因此,您需要手动设置它,即需要等待元素加载 . 默认情况下,Selenium不会等待,如上所述 .
另请注意:https://sqa.stackexchange.com/questions/2606/what-is-seleniums-default-timeout-for-page-loading提到“超时的默认WebDriver设置为 never ”