ajay k ajay k - 29 days ago 15
Java Question

how to set path for executable IE 11 drivers

I am New to Selenium I'm trying to Integrate HP ALM with Selenium. I am trying to Launch HP ALM in IE 11. I'm not getting correct webdrivers for IE11.
The Following is Error:


FAILED CONFIGURATION: @BeforeClass Init
java.lang.IllegalStateException: The path to the driver executable
must be set by the webdriver.ie.driver system property; for more
information, see
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver.
The latest version can be downloaded from
http://selenium-release.storage.googleapis.com/index.html at
com.google.common.base.Preconditions.checkState(Preconditions.java:197)
at
org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at
org.openqa.selenium.ie.InternetExplorerDriverService.access$0(InternetExplorerDriverService.java:1)
at
org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167)
at
org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at
org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:146)
at database.Test1.Init(Test1.java:23) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
at
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.privateRun(TestRunner.java:773) at
org.testng.TestRunner.run(TestRunner.java:623) at
org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at
org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at
org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at
org.testng.SuiteRunner.run(SuiteRunner.java:259) at
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at
org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at
org.testng.TestNG.run(TestNG.java:1018) at
org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at
org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at
org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)


After browsing to the webforums giving in the Error. I am getting the above error. Could the experts help me with this issue. Also I would be requiring the guidelines for running test sets in QC using Selenium.

Answer

The error message tells you (almost) exactly what to do:

The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html

Download the latest IE Driver server (64 or 32 bit - this is important) from http://selenium-release.storage.googleapis.com/index.html?path=2.49/, get it running according to the instructions, and then simply do:

System.setProperty("webdriver.ie.driver", "<your download location>");

in your @BeforeClass before you create your WebDriver reference.