0

I am using the Selenium API, but I got the error

Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property;

Expected location of Chrome is

/usr/bin/google-chrome

but in my computer it is in
/usr/bin/google-chrome

I'm using Ubuntu, how I can fix this issue,

2 Answers 2

3

After downloading the chrome driver from here - http://chromedriver.storage.googleapis.com/index.html?path=2.20/

you will have to add following lines to your code

System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver"); WebDriver driver = new ChromeDriver();

Sign up to request clarification or add additional context in comments.

Comments

2

I believe you have not downloaded, external chrome driver file for ubuntu. You should download chrome driver file ubuntu from here. WebDriver API will not work with your already installed chrome browser like Firefox or Safari Browser.

After you have downloaded, You can either include the ChromeDriver location in your PATH environment variable or specify its location via the system property. Here is the link to get started with ChromeDriver.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.