Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I tried this

WebDriver driver = new ChromeDriver();

But I'm getting the error as

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 code here. The latest version can be downloaded from Link

How can I make Chrome to test the Selenium-WebDriver test cases?

1 Answer

0 votes
by (62.9k points)

You need to download the executable driver from ChromeDriver Download

Then all you need to do is use the following before creating the driver object (already shown in the correct order):

 System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");

WebDriver driver = new ChromeDriver();

This was extracted from the most useful guide from the ChromeDriver Documentation.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...