browser not responding to webdriver after pageLoadTimeout expires (selenium webdriver 2.20)

1,916 views
Skip to first unread message

Mark_es

unread,
Feb 28, 2012, 2:37:09 PM2/28/12
to Selenium Users
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!

paul garcia

unread,
Feb 28, 2012, 3:15:07 PM2/28/12
to seleniu...@googlegroups.com

You suggest using this method to give a time out... What about the thread.sleep() method... WOuld that do the trick ?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Mark_es

unread,
Feb 28, 2012, 3:28:13 PM2/28/12
to Selenium Users
Thread.sleep() will not work (unless I'm not understanding your
intention) because driver.get() is a blocking call. Control is not
returned from .get unless the timeout is used. Any other ideas though?

On Feb 28, 12:15 pm, paul garcia <pbrai...@gmail.com> wrote:
> You suggest using this method to give a time out... What about the
> thread.sleep() method... WOuld that do the trick ?
> On Feb 28, 2012 3:10 PM, "Mark_es" <empyreanst...@gmail.com> wrote:
>
>
>
>
>
>
>
> > 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/sel...
> > ,
> > 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...

ghostwords

unread,
Feb 29, 2012, 1:13:24 PM2/29/12
to seleniu...@googlegroups.com
Related ticket: http://code.google.com/p/chromedriver/issues/detail?id=23
> > To post to this group, send email to selenium-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > selenium-users+unsubscribe@googlegroups.com.

Mark_es

unread,
Feb 29, 2012, 2:48:55 PM2/29/12
to seleniu...@googlegroups.com
Also, the above Issue 23 in Chromedriver was merged into Issue 9 (also linked to above) http://code.google.com/p/chromedriver/issues/detail?id=9

Looking forward to further general support for pageLoadTimeout. Any chrome-specific workaround ideas in the meanwhile would be appreciated, thanks all!
Reply all
Reply to author
Forward
0 new messages