Setting 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:199)

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

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

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

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

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

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

Jun 26, 2018 in Selenium by Martin
• 4,320 points
6,538 views

1 answer to this question.

0 votes

When u use Selenium 3.x you should download chromedriver.exe and save it in your machine. Then u have to add the absolute path of the chromedriver.exe using System.setProperty.

Make sure while you mention the absolute path of the chromedriver.exe through System.setProperty, you should either provide front slashes "/" or esacpe the back slases "\\".

Below code will help you:

public class first

{

    public static void main(String args[])

    {

        System.setProperty("webdriver.chrome.driver","C:/your_directory/chromedriver.exe");

        WebDriver dr1= new ChromeDriver(); ;

        dr1.get("http://www.google.com/");

    }

}
answered Jun 26, 2018 by Samarpit
• 5,850 points

Related Questions In Selenium

0 votes
1 answer

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

Hi Sivaranjani, to resolve your issue, Driver path ...READ MORE

answered Sep 3, 2019 in Selenium by Abha
• 27,720 points
662 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
3,113 views
0 votes
1 answer

System.setProperty("webdriver.chrome.driver","") meaning?

The meaning of the statement are almost ...READ MORE

answered Jan 8, 2019 in Selenium by Nabarupa
8,039 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
1,500 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,850 points
1,470 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,850 points
1,234 views
0 votes
1 answer

Maximizing the browser window in Selenium WebDriver using C#

Check this first: http://code.google.com/p/selenium/issues/detail?id=174 You Can use the JavascriptExector as follows: public ...READ MORE

answered May 2, 2018 in Selenium by Samarpit
• 5,850 points
106 views
+1 vote
1 answer

How to handle notifications in Python with Selenium (Chrome WebDriver)

Below will help you: You can disable the ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,850 points
3,164 views