webdriver compatibility with IE8

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

webdriver compatibility with IE8

zlos7ar
In IE9 after i login into the site i am trying to test "document mode changes from IE9 to IE8". As far as I know that means that IE9 will act like IE8. So maybe that is the reason I had so many problems trying to optimize my tests for IE9. OK my question is if webdriver is compatible with ie8 , because i face so many problems with it. I can not fire blur event (which is crucial for me), i can not select anything from a drop down select menu, and i can not even click on a check box...... and all of those work flawlessly in firefox.
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

softwaretestingforum
Administrator
WebDriver is indeed compatible with IE8. I do all those operation in IE8 (except blur) have not encountered any exception.
Can you describe the errors you encounter when you select drop down value or click on check box?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

zlos7ar
thats for clicking on the checkbox:

org.openqa.selenium.InvalidSelectorException: The xpath expression '//*[@id='content-container']/div[5]/div[4]/label[1]/input' cannot be evaluated or does notresult in a WebElement (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 85 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
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:175)
        at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:128)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:459)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:227)
        at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:312)
        at org.openqa.selenium.By$ByXPath.findElement(By.java:344)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:219)
        at blurtest.testSubmitIdea(blurtest.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)






this is the code :
driver.findElement(By.xpath("//*[@id='content-container']/div[5]/div[4]/label[1]/input")).click();
and the html code :
<input type="checkbox" value="2" name="categories[]"/>

and i can use only xpath and maybe value (i don't know how) ?
and i am sure that the xpath is correct.


for the select i have some kind of syntax error now and i can not find it :
new Select(driver.findElement(By.xpath("//*[@id='content-container']/div[5]/div[3]/select"))).selectByVisibleText("text");

Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

softwaretestingforum
Administrator
This post was updated on .
I assume that you have tested your element locators in firebug or xpath.
About input element, can you try this element locator -

//input[@name='categories']

About the drop down selection, what is the syntax error you encounter?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

zlos7ar
i can not use //input[name='categories']  because i have 6-7 checkboxes with the same name

for the drop down i don't know just "Select" is underlined and i can not figure out why. I did ctrl+shift+o in eclipse so its not library problem i think
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

softwaretestingforum
Administrator
About input, looking at the error it seems that locator is not correct.
About Select you need to import - import org.openqa.selenium.support.ui.Select;
have you?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

zlos7ar
ok so it appears that the xpath is problem for IE because it does not have native support for it. I added the import and changed the find element by xpath to find element by name and now the select works. Can i somehow use findElement.By.Value or something like that since the only difference in my checkboxes is the value and the xpath ?
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

softwaretestingforum
Administrator
You can use value attribute like this in xPath -

//input[@value='2']
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: webdriver compatibility with IE8

zlos7ar
actually nothing with xPath does not work :) but nevermind we will create unique id-s at later point for all the elements