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

0 votes
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 54 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.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

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
• 11,040 points

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
+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
0 votes
0 answers

Unable to pass url in firefox and chrome by using selenium webdriver

Hi All, I am not able to run ...READ MORE

May 1 in Selenium by anonymous

edited May 2 by Omkar 67 views
0 votes
1 answer

Java.lang.CharSequence cannot be resolved error while using sendKeys() using Selenium Webdriver

You could try this, myElement .sendKeys(new String[] { ...READ MORE

answered Apr 4, 2018 in Selenium by Johnathon
• 9,070 points
0 votes
2 answers

I am trying to run the below code but java.lang.Illegalstate Exception is coming

You are facing this error because while ...READ MORE

answered 5 days ago in Selenium by Abha
• 11,040 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.