0

What is the default timeout that HtmlUnitDriver uses when waiting for a page to load?

Which functions in the HtmlUnitDriver API can I call to get the timeout value?

HtmlUnitDriver h = new HtmlUnitDriver();

I don't see any gettimeout function in the JavaDoc of WebDriver or HtmlUnitDriver.

Additionally, if this timeout is too short, how do I set a bigger timeout?

serg10
  • 31,923
  • 16
  • 73
  • 94
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98

2 Answers2

2

You can use pageLoadTimeout to set the timeout if you want.

Refer : http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebDriver.Timeouts.html#pageLoadTimeout%28long,%20java.util.concurrent.TimeUnit%29

h4k3r
  • 91
  • 5
1

get(url) is the method used to load web page in browser. But for that I coulnd't find out what is exact timeout for page load looking at here

If, in your case, page isn't loaded and timeout error is thrown then you can use pageLoadTimeout method.

Alpha
  • 13,320
  • 27
  • 96
  • 163
  • How do i access this timeouts object from the webdriver? This looks like an inner class/interface. I don't see any function where i can access or set this object? – David Michael Gang May 07 '14 at 09:02
  • 1
    You can achieve that using - `driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);` – Alpha May 07 '14 at 09:11
  • Thanks. Regarding the timeout default, the htmlunit driver contains the htmlunit object and there is an options object which contains a timeout of 90 seconds, so i assume that this is the timeout – David Michael Gang May 07 '14 at 09:38