Timed out after 30000ms when I try to go next page by clicking Submit button [duplicate]

北战南征 提交于 2019-12-11 23:41:31

问题


Possible Duplicate:
Timed out after 30000ms when I try to go next page by clicking Submit button

I am using Selenium RC by java.Fill up necessary data on 1st page-->Click Submit button to go next page. My code is: selenium.click("Submit"); selenium.waitForPageToLoad("30000"); After clicking Submit button I found the error: com.thoughtworks.selenium.SeleniumException: Timed out after 30000ms

Can anybody pls help me?


回答1:


This could be because of slow internet connection. If page does not get downloaded fully on the specified time, the selenium server throws timeout error. Try when you get good internet speed of at least 40kB/s.




回答2:


Try:

selenium.clickAndWait("Submit");

without waitForPageToLoad().




回答3:


If your form just triggers some AJAX query and not real page load, then you can't wait for the page to load, since from Selenium's perspective, it's already loaded.




回答4:


It's much more reliable to wait for a specific change on the page. For example a specific text to appear or the title to change.

If you absolutely need to wait for submit and you use Ajax, you can build a waitForAjax function. For prototype.js you can find examples at http://davidvollbracht.com/2008/6/4/30-days-of-tech-day-3-waitforajax and http://codelevy.com/2007/11/05/selenium-and-ajax-requests. For dojo you can find an example at https://i-proving.com/space/Dion+Lew/blog/2008-10-23_1.



来源:https://stackoverflow.com/questions/5164638/timed-out-after-30000ms-when-i-try-to-go-next-page-by-clicking-submit-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!