Some of my requests using driver.get() currently block forever (or at
least more than a few minutes, haven't waited longer yet in case
there's an internal timeout of tens of minutes). If you're curious,
this happens on requests across complicated proxy rules, or to very
slow/overloaded servers.
It looks like a solution to interminable blocking is offered by the
latest version of webdriver via
driver.manage().timeouts().pageLoadTimeout() (currently this seems
only supported in Firefox, please correct me if I'm wrong). I'm not
using the unstable load strategy.
Javadoc for pageLoadTimeout:
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.Timeouts.html#pageLoadTimeout(long,
java.util.concurrent.TimeUnit)
My problem:
When the timeout expires, I can catch an exception, but if I want to
retry navigating using driver.get(), or if I just want to try to
navigate somewhere else instead, the driver doesn't respond to another
navigation request or anything else. Firefox won't even respond to a
driver.navigate().back() call.
My only solution so far is to call driver.quit(), and start up a new
instance of the browser. But that's too heavyweight for a robust
solution unfortunately.
My questions:
1) Is there another, better way to go about navigation requests that
may not resolve? Some way to, for instance, somehow press the 'stop'
button after a set time limit in the browser, and try again or
continue to navigate somewhere else?
2) In Firefox, does pageLoadTimeout necessitate the use of the
unstable load strategy? If it is not necessary then how can I issue
any further navigation requests to the browser?
fp.setPreference("webdriver.load.strategy", "unstable"); from
http://code.google.com/p/selenium/wiki/FirefoxDriver#-Beta-_load_fast_preference
3) If the answer to (2) is that unstable is necessary, then is there a
plan known for chromedriver support? I see an issue for support of
pageLoadTmeout in chromedriver
http://code.google.com/p/chromedriver/issues/detail?id=9
but no further information. I'm new to selenium and chromedriver so if
this last question is not appropriate for the users group I can ask it
somewhere else.
My platform: Firefox 10.0.2 on Mac OS X 10.6.8 using selenium-java
2.20.0
Thanks!