I'm using GhostDriver (PhantomJsDriver). It's implicit wait set to 2 seconds: driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS)
When trying to find an element in the DOM that doesn't exist (as expected), WebDriver trying polling the element for much longer time:
[ERROR - 2015-05-06T12:15:25.137Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1430914525093
[ERROR - 2015-05-06T12:15:27.716Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1430914527641
[ERROR - 2015-05-06T12:15:30.579Z] WebElementLocator - _handleLocateCommand -
...
[ERROR - 2015-05-06T12:17:47.598Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1430914667555
[ERROR - 2015-05-06T12:17:50.481Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1430914670467
The first time equal to: 12:15:25, the last time equal to: 12:17:50 (using epoch convertor).
It's about ~2 minutes of timeout, when the implicit wait set to 2 seconds.
In PhantomJs code (which is the backend for GhostDriver), the wait looks pretty simple:
if (elementOrElements) {
_log.error("_handleLocateCommand", "Element(s) NOT Found: GAVE UP. Search Stop Time: " + stopSearchByTime);
_errors.handleFailedCommandEH(elementOrElements.status,
elementOrElements.value.message,
req,
res,
_session);
return;
}
But in this case doesn't take into account at all the implicit waiting time. So, how this wait time controlled? What could be the cause for the ultra-long wait time?