Unable to resolve error: Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property

+1 vote
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

at com.google.common.base.Preconditions.checkState(Preconditions.java:847)

at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:134)

at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)

at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:159)

at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:355)

at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)

at edureka.Firstscripts.main(Firstscripts.java:13)
Jun 5 in Selenium by Haritha

edited Jun 10 by Abha 673 views
Have you set the ChromeDriver path properly before launching the chrome driver? Can you share your code where you have initialized the chrome driver?

1 answer to this question.

+1 vote

Hey Haritha, you can resolve your error by following these steps:

  1. Please download the Chrome driver from here: https://chromedriver.storage.googleapis.com/index.html?path=2.45/
  2. The reason for your error might be because you have to provide the path to chromedriver.exe in your code. Do it using System.setProperty()
  3. In Elipse IDE, path to chromedriver.exe will have to double slashes everywhere and not single slashes which is how usually the path is. Below code is how you should do it:
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Abha_R\\Downloads\\chromedriver_win32.exe");
WebDriver driver = new ChromeDriver();
answered Jun 10 by Abha
• 27,180 points
I am also facing this issue, How can I solve this issue ? Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; I tried with many versions (downloaded different versions, but not solved yet). Anybody can help me, please. Thank you in Advance

Related Questions In Selenium

0 votes
1 answer
0 votes
3 answers

java.lang.IllegalStateException Error after adding set property webdriver

/* System.setProperty("WebDriver.gecko.driver", "C:\\Users\\DELL\\Desktop\\GeckoDriver1\\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); */ ...READ MORE

answered May 1 in Selenium by anonymous
3,985 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

Setting the webdriver.chrome.driver system property

When u use Selenium 3.x you should ...READ MORE

answered Jun 26, 2018 in Selenium by Samarpit
• 5,130 points
5,389 views
0 votes
1 answer