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 in Selenium by Sivaranjani
• 120 points
156 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 by Abha
• 24,320 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
3,555 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,130 points
4,923 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 in Selenium by anonymous
2,345 views
+1 vote
1 answer
0 votes
1 answer
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,080 points
707 views