0

When I open an executable jar file on a different computer I am getting the below chrome exception error. I am getting a doubt something went wrong in exporting the jar file, can someone advise how to fix this? Thanks.

Exception in thread "main" java.lang.IllegalStateException: The driver executabl
e does not exist: C:\ChromeWebDriver\chromedriver.exe
        at com.google.common.base.Preconditions.checkState(Preconditions.java:19
7)
        at org.openqa.selenium.remote.service.DriverService.checkExecutable(Driv
erService.java:122)
        at org.openqa.selenium.remote.service.DriverService.findExecutable(Drive
rService.java:117)
        at org.openqa.selenium.chrome.ChromeDriverService.access$0(ChromeDriverS
ervice.java:1)
        at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExe
cutable(ChromeDriverService.java:118)
        at org.openqa.selenium.remote.service.DriverService$Builder.build(Driver
Service.java:291)
        at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(C
hromeDriverService.java:82)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117)

        at PSOCUST03.PSOCUST03.main(PSOCUST03.java:24)

1 Answers1

0

Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\ChromeWebDriver\chromedriver.exe

It seems that the other computer don't have chromedriver.exe placed at the given location.

  1. Either place the chromedriver at that location.
  2. Save chromedriver with your jar in same folder.

Hope that solves your issue. Let me know if you have any queries.

Manu
  • 2,251
  • 19
  • 30
  • Thanks for your reply, first one worked out well. can you please advise how to include the chromedriver in Jar itself as mentioned in point 2? so that I can give all- in -one for my team to run. Actually I am using eclipse to export the application – KSNath Kodi Aug 01 '15 at 00:57
  • For the second one, place the chromedriver in a folder in your project before export and then give relative link to it. Either drag-drop the chromedriver or follow [this](http://stackoverflow.com/questions/8253861/is-there-an-equivalent-of-add-existing-file-to-project-in-eclipse). – Manu Aug 02 '15 at 15:20
  • I have placed the chromedriver in the folder and gave the link to it, it launches fine on the eclipse but not from the executable jar file. neither on the local machine nor on the remote computer – KSNath Kodi Aug 03 '15 at 22:23
  • It seems from this [link](http://stackoverflow.com/questions/21650178/how-can-i-include-chromedriver-in-a-jar) that .exe files won't run from jar file. So, you may save the jar and chromedriver in same folder instead of including it in jar. I edited my answer. – Manu Aug 04 '15 at 06:55