InternetExplorerDriver don't wait for page to load after get(url)

617 views
Skip to first unread message

Alexei Barantsev

unread,
Apr 12, 2011, 4:36:31 PM4/12/11
to selenium-...@googlegroups.com
Hi, 

I was going to retest http://code.google.com/p/selenium/issues/detail?id=1318 in 2.0b3, but have found even worse problem.

1. When I run the same piece of code as present in #1318, I get NPE in line
    WebElement form = browser.findElements(By.tagName("form")).get(1);

I've run code in debugger, and found that selenium don't wait for page to load in previous line
and tries to find elements while page is not loaded yet.

But that's not the only problem!

2. I've added Thread.sleep(10000) after get(url) to wait for page explicitly -- and NPE is still here!

After short exploration I've found that findElements just returns null everytime, even if I call browser.findElements(By.tagName("body")) or browser.findElements(By.xpath("//body")).

Call to browser.findElement(By.tagName("body")) or browser.findElement(By.xpath("//body")) gives the following stack trace:

Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to find element with tag name == body (WARNING: The server did not provide any stacktrace information)
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:192)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByTagName(RemoteWebDriver.java:233)
at org.openqa.selenium.By$5.findElement(By.java:178)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:184)
at demo.Experiment.main(Experiment.java:21)

I've checked IE8 and IE9 (both on Windows 7), selenium 2.0b3 and trunk -- with the same result.

What's that? Do anybody have success with IE?

Regards,
Alexei Barantsev
Software-Testing.Ru

Jim Evans

unread,
Apr 13, 2011, 8:56:39 AM4/13/11
to Selenium Developers
I have translated the code in the bug report to C#, and run the test
successfully without modification. I did not have to add additional
waits or synchronization code. I've run the test on Windows 7 x64 with
IE8; I've not tried IE9. Have you made sure that the Protected Mode
settings of IE are set correctly for use with the IE driver (Tools >
Internet Options... > Security tab > Enable Protected Mode checkbox,
must be set to the same value for all zones)?

--Jim

On Apr 12, 4:36 pm, Alexei Barantsev <baran...@gmail.com> wrote:
> Hi,
>
> I was going to retesthttp://code.google.com/p/selenium/issues/detail?id=1318in 2.0b3, but have
> org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:1­31)
> at
> org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.­java:105)
> at
> org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409­)
> at
> org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java­:192)
> at
> org.openqa.selenium.remote.RemoteWebDriver.findElementByTagName(RemoteWebDr­iver.java:233)

Alexei Barantsev

unread,
Apr 13, 2011, 9:33:35 AM4/13/11
to selenium-...@googlegroups.com
Have you made sure that the Protected Mode 
settings of IE are set correctly for use with the IE driver (Tools > 
Internet Options... > Security tab > Enable Protected Mode checkbox, 
must be set to the same value for all zones)? 


Aha! That helped, thank you!

Regards,
-- 
Alexei Barantsev.
Software-Testing.Ru
Reply all
Reply to author
Forward
0 new messages