开发者

Selenium's waitForPageToLoad not reliable?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜