operasoftware / operaprestodriver

OperaPrestoDriver is a vendor-supported WebDriver implementation that enables programmatic automation of Presto-based Opera products (i.e. v12 and older).
http://code.google.com/p/selenium/wiki/OperaDriver
Apache License 2.0
148 stars 65 forks source link

Slow-loading inline javascript causes No response in a timely fashion exception, regardless of page loading timeout #67

Open illicitonion opened 12 years ago

illicitonion commented 12 years ago

If javascript causes a page load to take a long time, regardless of the page load timeout, a ResponseNotReceivedException will be thrown.

If the slow-loading javascript was document.write'n to the page, the get will throw during the nested switch to defaultContent. If the slow-loading javascript is just inline in the page, the get will return cleanly, but the following command will throw.

Test cases:

WebDriver driver = new OperaDriver(); driver.get("http://illicitonion.com/sebugs/operadriver-timely1/index.html"); assertEquals("Page", driver.getTitle());

WebDriver driver = new OperaDriver(); driver.get("http://illicitonion.com/sebugs/operadriver-timely2/index.html"); assertEquals("Page", driver.getTitle());

Source of example pages is available at http://illicitonion.com/sebugs/operadriver-timely.tar - I can't work out a way to attach files to this issue, I guess you're meant to use a pull request or gist or something...

If your computer is more powerful than mine, you may need to add a few extra zeros to the hard-coded powers of 10 :)

illicitonion commented 12 years ago

Ok, I thought a had a workaround, by waiting until the page loads and then switchTo().defaultContent()ing, but this call will also throw the exception, even if the page is fully loaded.