Not able to run WebDriver test with Google Chrome

0 votes

So my code is working with Firefox, but it is not working with Chrome. The erros is apparently in this line itself:

WebDriver driver = new ChromeDriver();

And here is the error log report:

Failed tests: setUp(com.TEST): The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list
Apr 20, 2018 in Selenium by kappa3010
• 2,090 points
1,315 views

1 answer to this question.

0 votes

Firefox is just default browser for tests uptill v2. For doing it with Chrome, you have to use system.setProperty() method to specify the path where your ChromeDriver is present. First of all download the .exe from this link and then provide its path like below: https://sites.google.com/a/chromium.org/chromedriver/downloads

System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();
answered Apr 20, 2018 by king_kenny
• 3,710 points

Related Questions In Selenium

0 votes
2 answers

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

You first need to download chrome driver ...READ MORE

answered Aug 26, 2019 in Selenium by Abha
• 28,040 points
1,034 views
0 votes
1 answer
0 votes
1 answer

Not able to set ChromeDriver to run a TestNG programm

You have not set the system properties ...READ MORE

answered Apr 19, 2018 in Selenium by Meci Matt
• 9,460 points
1,308 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
5,920 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
6,391 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,890 points
4,025 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 2, 2020 in Selenium by Sri
• 3,190 points
4,974 views
+3 votes
1 answer

Not able to run in chrome

There is a very silly mistake in ...READ MORE

answered May 15, 2018 in Selenium by king_kenny
• 3,710 points
754 views
0 votes
1 answer

How to handle the popup of file upload in Windows OS with WebDriver?

The value of name locator has probably ...READ MORE

answered Apr 25, 2018 in Selenium by king_kenny
• 3,710 points
13,373 views