INSTANT Time out waiting for page load

495 views
Skip to first unread message

phillip...@gmail.com

unread,
Jun 2, 2015, 10:28:30 PM6/2/15
to seleniu...@googlegroups.com
Hi

I've been getting the "Timed out waiting for page load" error right after an element is clicked in my code. I am absolutely sure that the time out doesn't really occur - for some reason I get that exception immediately after the click() method is called, though. It is a search button that is clicked (the search form is submitted) and then a few seconds after that I get the timeout. That's all on Linux, using Java, Selenium 2.45.0 (more details in the stack trace below).

I managed to work it around by adding a click() to an empty div before clicking the failing element. Looks like some sort of focus issue. It only happens when I'm running it using Jenkins and there's no mouse pointer hovering the page. If I open the screen of my Jenkins server and watch the test case running, the problem doesn't happen.

public static WebElement searchButton(WebDriverExtended driver) {
    return driver.findElementAndWait(By.className("search-form")).findElement(By.id("applicationSearchButton"));
}

On another page I call the click() method for the WebElement:

Page.searchButton(driver).click();


Then I IMMEDIATELY get a "Timed out waiting for page load" error, even though I am sure the time out didn't occur. The full stack is:

"Timed out waiting for page load. Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50' System info: host: 'jenkins-slave-test.intranet', ip: '10.25.28.93', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-504.8.1.el6.x86_64', java.version: '1.7.0' Driver info: driver.version: unknown Command duration or timeout: 11.42 seconds Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-27 00:00:10' System info: host: 'jenkins-slave-test.intranet', ip: '10.25.28.93', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-504.8.1.el6.x86_64', java.version: '1.7.0' Session ID: e9b98647-706a-4a9f-8e12-33b848c7ea7c Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities [{platform=LINUX, javascriptEnabled=true, acceptSslCerts=true, browserName=firefox, rotatable=false, locationContextEnabled=true, webdriver.remote.sessionid=e9b98647-706a-4a9f-8e12-33b848c7ea7c, version=31.6.0, databaseEnabled=true, cssSelectorsEnabled=true, handlesAlerts=true, webStorageEnabled=true, nativeEvents=false, applicationCacheEnabled=true, takesScreenshot=true}]" type="org.openqa.selenium.TimeoutException">org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'jenkins-slave-test.intranet', ip: '10.25.28.93', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-504.8.1.el6.x86_64', java.version: '1.7.0'
Driver info: driver.version: unknown
Command duration or timeout: 11.42 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-27 00:00:10'
System info: host: 'jenkins-slave-test.intranet', ip: '10.25.28.93', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-504.8.1.el6.x86_64', java.version: '1.7.0'
Session ID: e9b98647-706a-4a9f-8e12-33b848c7ea7c
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, javascriptEnabled=true, acceptSslCerts=true, browserName=firefox, rotatable=false, locationContextEnabled=true, webdriver.remote.sessionid=e9b98647-706a-4a9f-8e12-33b848c7ea7c, version=31.6.0, databaseEnabled=true, cssSelectorsEnabled=true, handlesAlerts=true, webStorageEnabled=true, nativeEvents=false, applicationCacheEnabled=true, takesScreenshot=true}]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:542)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:331)
    at com.sun.proxy.$Proxy10.click(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:344)
    at com.comp.actions.impl.SearchProduct.execute(SearchProduct.java:30)


Can someone please advise?

Narendra Rajput

unread,
Jun 4, 2015, 11:34:01 PM6/4/15
to seleniu...@googlegroups.com
hi

       you can use implicit wait for page load using followint statement
     
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

phillip...@gmail.com

unread,
Jun 7, 2015, 11:36:02 AM6/7/15
to seleniu...@googlegroups.com
Hi Narendra

Thank you for your reply.

I actually have implicit wait configured :(

Any other ideas?

Phil

CH!NN@ K

unread,
Jun 8, 2015, 12:04:24 AM6/8/15
to seleniu...@googlegroups.com

 Synchronization :- 

  • Thread.sleep(9000);
     

  • selenium.waitForPageToLoad("9000");

  • selenium.setTimeout("90000");

  • WebDriverWaitwait=newWebDriverWait(driver,9);
    wait.until(ExpectedConditions.elementToBeClickable(By.id("element-id")));

     

  • driver.manage().timeouts().implicitlyWait(9,TimeUnit.SECONDS);

  • robot.delay(1000);


---
Thanks & Regards,
Purushotham Karimbedu,
Drupal Developer and QA Engineer,
Website for Selenium : http://techlearn.in


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0bccce81-9229-4d7c-9b77-9bd14e6417d6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mercious

unread,
Jun 9, 2015, 4:22:17 AM6/9/15
to seleniu...@googlegroups.com
We don't even know what WebDriverExtended is. You are using a non-standard and most likely self written implementation of the driver and experiencing random issues ... So one might think that the implementation is faulty.

Show it.

Also, what browsers are you using? Most browsers handle page-navigation automatically quite flawlessly (IE doesn't). 
Reply all
Reply to author
Forward
0 new messages