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,210 points
2,224 views

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

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,130 points

Related Questions In Selenium

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
1,133 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Latest Version of Chrome Driver for Selenium Webdriver

The driver versions mentioned on the site ...READ MORE

answered Apr 11, 2018 in Selenium by DareDev
• 6,520 points
305 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,030 points
51 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,130 points
412 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,130 points
40 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,130 points
45 views
0 votes
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,130 points
1,350 views

© 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.