getting java lang IllegalStateException The path to the driver executable must be set by the webdriver chrome driver system property

0 votes
WebDriver driver = new ChromeDriver();

System.setProperty("webdriver.chrome.driver","C:\\Users\\HP\\Desktop\\Selenium\\Selenium\\driver\\chromedriver.exe");

driver.get("https://www.facebook.com/");

chromedriver exe file is available in the mentioned path.

could anyone please help on this . thanks
Sep 3, 2019 in Selenium by Sivaranjani
• 120 points
15,848 views

1 answer to this question.

0 votes

Hi Sivaranjani, to resolve your issue, Driver path should be set before browser launch as given below.

System.setProperty("webdriver.chrome.driver","C:\\Users\\HP\\Desktop\\Selenium\\Selenium\\driver\\chromedriver.exe");
WebDriver driver =new ChromeDriver();
driver.get("https://www.facebook.com/");

answered Sep 3, 2019 by Abha
• 28,140 points
public class BaseClass {

public WebDriver driver;

public WebDriver initializeBrowser() throws IOException {

Properties prop = new Properties();

FileInputStream fis = new FileInputStream(

"C:\\Users\\UJJAWAL\\eclipse-workspaceNupur\\EtoEProject\\src\\main\\java\\MavenAcademy\\data.properties");

prop.load(fis);

String browserName = prop.getProperty("browser");

if (browserName.equalsIgnoreCase("Chrome")){

System.setProperty("Webdriver.chrome.driver","C:\\Users\\UJJAWAL\\Downloads\\chromedriver_win32\\chromedriver.exe");

driver = new ChromeDriver();

--> I m still getting the same issue
Can you please check if if your have set the right path for your Chrome driver?

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: how to solve it?

Your query is similar to https://www.edureka.co/community/46570/illegalstateexception-executable-automation-chromedriver Check it ...READ MORE

answered Nov 6, 2020 in Selenium by Sirajul
• 59,230 points
3,303 views
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, 2019 in Selenium by anonymous
19,965 views
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,910 points
17,716 views
0 votes
2 answers

webdriver.ie.driver System Property setting driver executable

System.setProperty("webdriver.chrome.driver","C:\\Users\\vthaduri\\workspace\\LDCSuite\\IEDriverServer.exe"); your miss take is webdriver.chrome.driver but, we have ...READ MORE

answered Apr 24, 2019 in Selenium by anonymous
8,735 views
+1 vote
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP