Timed out after 30000ms when I try to go next page by clicking Submit button [duplicate]
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("开发者_JS百科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?
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.
Try:
selenium.clickAndWait("Submit");
without waitForPageToLoad()
.
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.
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.
精彩评论