Help needed for this error - "The driver executable does not exist: C:\selenium\gecko\geckodriver"

6,386 views
Skip to first unread message

Vlatko Stoimenovski

unread,
Dec 9, 2016, 4:03:08 AM12/9/16
to Selenium Users
I'm getting this error message : 


Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\selenium\gecko\geckodriver
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:121)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116)
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:238)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at attempt.AttemptClass.main(AttemptClass.java:13)


And I have gecko driver in c:/selenium/gecko/geckodriver      

Any advice?

This is my code: 

package attempt;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;



public class AttemptClass {

public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver" , "C:\\selenium\\gecko\\geckodriver");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.toolsqa.com");
System.out.println("Successfully opened website www.Store.Demoqa.com ");
Thread.sleep(5);
driver.quit();

}

}

Harry King

unread,
Dec 9, 2016, 4:10:29 AM12/9/16
to Selenium Users
Assuming the file is in the location, it looks like you are missing the .exe extension - Try using C:\selenium\gecko\geckodriver.exe

Vlatko Stoimenovski

unread,
Dec 9, 2016, 4:21:42 AM12/9/16
to Selenium Users

I tried that too

⇜Krishnan Mahadevan⇝

unread,
Dec 9, 2016, 4:38:20 AM12/9/16
to Selenium Users
Please check if this helps : http://stackoverflow.com/a/15218949/679824

It is also possible that sometimes this error can come up due to permission issues as well (Java is NOT able to access this file due to permission differences of the file vs the permissions that are available for the Java process)

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
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/d5b4734e-b6f1-4243-bcd0-7ed294b17051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vlatko Stoimenovski

unread,
Dec 12, 2016, 9:16:51 AM12/12/16
to Selenium Users
...but when i add one more .exe (example: System.setProperty("webdriver.gecko.driver", "C://selenium/gecko/geckodriver.exe.exe"); ) it gives me new error. I think I'm a step closer to a solution. Now I have to deal with this error :

    C:\selenium\gecko\geckodriver.exe.exe [OPTIONS]
C:\selenium\gecko\geckodriver.exe.exe: Unknown option --port=20070
XII 12, 2016 4:12:33 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Exception in thread "main" org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:20070 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
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.

Anish Pillai

unread,
Dec 12, 2016, 6:22:11 PM12/12/16
to Selenium Users
Hi,

The correct way is one in which you add .exe at the end.
System.setProperty("webdriver.gecko.driver" , "C:\\selenium\\gecko\\geckodriver.exe");

Not sure if its related to some permissions error on C:\. Also, I'm assuming that you are using the latest versions of Firefox, Geckodriver and Selenium.


Can you also try adding geckodriver in environment variables and see if it helps? This way you would not need the to use System.setProperty() method. Check below article for the steps -

http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/


Cheers,
Anish

Vlatko Stoimenovski

unread,
Dec 13, 2016, 3:00:24 AM12/13/16
to Selenium Users
Anish thanks for your response. 

Changing "webdriver.gecko.driver" with "webdriver.firefox.marionette" saved my life! example:

Correct

System.setProperty("webdriver.firefox.marionette","C://selenium/gecko/geckodriver.exe");

Not correct

System.setProperty("webdriver.gecko.driver","C://selenium/gecko/geckodriver.exe");

thanks and best regards to all of you.
Vlatko.

Vlatko Stoimenovski

unread,
Dec 13, 2016, 6:54:52 AM12/13/16
to Selenium Users


Now the browser opens but that's it. Doesn't open the page I would like to be opened (in this case youtube.com)with this error msg: "org.openqa.selenium.firefox.NotConnectedException:
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: \e10sr...@mozilla.org.xpi".  Here is screenshot from my code.

Anish Pillai

unread,
Dec 13, 2016, 5:54:38 PM12/13/16
to Selenium Users
Cool.. :) :)

Can you also please let us know the versions of Selenium,GeckoDriver and Firefox you were using? Earlier versions used to work with "webdriver.firefox.marionette" and the latest versions didn't seem to have any problem with "webdriver.gecko.driver"

Vlatko Stoimenovski

unread,
Dec 14, 2016, 3:29:09 AM12/14/16
to Selenium Users
Firefox version --> 50.1.0
Selenium version --> 3.0.1
Gecko driver --> v0.11.1

smita shelke

unread,
Apr 18, 2017, 5:16:03 PM4/18/17
to Selenium Users
Hi,

Even I am facing the same problem, what solution u found can you please share.

snigdha narain

unread,
Sep 7, 2017, 2:53:25 AM9/7/17
to Selenium Users
help needed ,i m nt able to run the same code for Mac 

package website;



import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;


 public class Neddoc {

 

public static void main(String[] args) {

  System.setProperty("webdriver.gecko.driver", "/Users/sn‌​igdhanarain/Document‌​s/geck");

  WebDriver driver = new FirefoxDriver();

  driver.get("google.com");

}

}

Firefox version :55.0.3 (64-bit)

Selenium : Eclipse IDE for Java Developers

Version: Neon.2 Release (4.6.2)

Build id: 20161208-0600

Geckdriver :v0.18.0 

L K

unread,
Feb 13, 2018, 12:13:56 AM2/13/18
to Selenium Users
You saved my life. Thanks

John Acosta

unread,
May 26, 2019, 9:37:45 AM5/26/19
to Selenium Users
I tried "webdriver.firefox.marionette"  but it just opens a blank page and times out... Did anyone find out how to do this?

Devendra Agarwal

unread,
May 26, 2019, 2:24:34 PM5/26/19
to seleniu...@googlegroups.com
Kindly check the version of the gecko driver. Is it compatible with the firefox as well as there is proper handshake b/w the driver and browser. 

Rgds,
Deven

--
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-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

D@nny Ruttle

unread,
May 26, 2019, 6:44:48 PM5/26/19
to seleniu...@googlegroups.com
Do you need to add the file extension .exe. ??

--
Reply all
Reply to author
Forward
0 new messages