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
17,722 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,910 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
• 28,140 points
15,854 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,741 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
59,264 views
0 votes
2 answers

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,500 points
13,686 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,149 views
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,910 points
7,228 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,880 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,910 points
1,161 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,910 points
14,432 views
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