user2014
user2014

Reputation: 171

Unable to launch IE browser - IllegalStateException while working with Internet Explorer browser in selenium

Exception in thread "main" 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:199)
    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.<init>(InternetExplorerDriver.java:172)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:146)
    at SamplePackage.SampleClass.main(SampleClass.java:16)

Here is my code :

File file = new File("C://Users//ctsuser//Downloads//selenium//IEDriverServer//IEDriverServer.exe");
System.setProperty("Webdriver.ie.driver", file.getAbsolutePath() );
WebDriver driver = new InternetExplorerDriver();

Upvotes: 0

Views: 1451

Answers (2)

Kishan Patel
Kishan Patel

Reputation: 1383

Yes this is common issue when you use IE. As mention above it should be 'webdriver.ie.driver', but onlt this change won't work.

Open regedit.exe

Open HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones

So Zones will contain 0,1,2,3,4 and on right hand side three columns will be visible as soon as you click on 0 i.e. Name Type Data

Now in Name column look for 2500 Double click it. Put Value data as 3 and Base as Hexadecimal

You did this for 0.

Now repeat the same steps for 1,2,3,4..

Do this for all i.e. 0,1,2,3,4,5 => Change all 2500's value data to 3.

Do reply whether the problem was solved or not.. I'll help you .. Happy Learning.. enjoy :-)

Upvotes: 0

murali selenium
murali selenium

Reputation: 3927

As per provided code, you used Capital 'W' in setProperty. In thrown exception it saying use

'webdriver.ie.driver'

please change it. it will solve the issue.

Thank You, Murali

Upvotes: 1

Related Questions