Selenium 3 - IllegalStateException

287 views
Skip to first unread message

Harish Dhage

unread,
Jan 5, 2017, 12:52:50 PM1/5/17
to Selenium Users
Hi,

I am using JDK 7, Mozilla version 45.6.0 and selenium-server-standalone-3.0.1.jar. But with these versions I am getting below error
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
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.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:135)
at com.library.commonLib.launchMozillaBrowser(commonLib.java:41)
at com.library.commonLib.loginApplication(commonLib.java:57)
at com.source.CreateTask.main(CreateTask.java:15)


My code as below
System.setProperty("webdriver.gecko.drive", "D:/Harish/Learning/ActiTime\\src/drivers/geckodriver.exe");
drive = new FirefoxDriver();

Please help me what could be the issue.

Thanks,
Harish

Sekhar Jasty

unread,
Jan 5, 2017, 1:31:02 PM1/5/17
to seleniu...@googlegroups.com
Hi Harish,
    Highlighted seems to be the error. 

System.setProperty("webdriver.gecko.drive", "D:/Harish/Learning/ActiTime\\src/drivers/geckodriver.exe");

it should as below if your drivers folder is correct. 
System.setProperty("webdriver.gecko.drive", "D:\\Harish\\Learning\\ActiTime\\src\\drivers\\geckodriver.exe");




Thanks,
Jasty


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/44d795cb-028c-4d57-9f06-7d9c2705388f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anish Pillai

unread,
Jan 6, 2017, 12:41:58 AM1/6/17
to Selenium Users
Hi Harish,

First of all, the syntax needs to be changed. In what Chandra mentioned, you still need to modify the property as webdriver.gecko.driver and the path format as mentioned by Chandra. Try if this works.

If you are still having this issue, then it might be due to FF version. GeckoDriver supports from FF version 47 and above. So try updating the FF version as well. Let us know if you still face the issue after updating to latest version of FF, GeckoDriver and Selenium.


Cheers,
Anish
www.automationtestinghub.com





Thanks,
Jasty


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

harshal shewale

unread,
Jan 12, 2017, 6:27:31 AM1/12/17
to Selenium Users
For Selenium 3.0 java 8 is must.
Go to bellow URL http://www.seleniumpoint.com/setup-selenium-webdriver-with-eclipse-java
Let me know via my website if still issue remians
Reply all
Reply to author
Forward
0 new messages