开发者

Selenium's waitForPageToLoad not reliable?

开发者 https://www.devze.com 2023-03-11 06:52 出处:网络
I am using Selenium to 开发者_开发知识库verify google.com First I type a Search query in the Search box, and click the Search button.

I am using Selenium to 开发者_开发知识库verify google.com First I type a Search query in the Search box, and click the Search button. The next page displays the Search results for the query.

I used

    selenium.waitForPageToLoad("60000");

and then check that some elements on this page exist. But I get a "ERROR: Command timed out" for the waitForPageToLoad command. Why does this happen?


This is actually a mixed bag problem. You may want to give clickAndWait a try, but with the changes to asynchronous requests all over the web some of that has become unreliable. Some pages, even with the great google, don't return to a ready state and the script cannot tell the difference. You can, however, turn to waits (waitForElementPresent, waitForPageToLoad) and the problem should go away or at least be more manageable. Until it is addressed you may want to go into your google preferences and turn off Google Instant.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号