Back

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

Can somebody tell me how to use the Chrome driver in Selenium for Linux platform?

I have my chrome driver location at username/home/chromedriver.

My code is:

System.setProperty("webdriver.chrome.driver", "/home/username/ChromeDriver/chrome‌​driver");

driver = new ChromeDriver();

driver.get("facebook.com");

The error I am getting is:

org.openqa.selenium.WebDriverException: Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date.

Using Chrome binary at: /opt/google/chrome/google-chrome

(WARNING: The server did not provide any stacktrace information)

1 Answer

0 votes
by (62.9k points)

For me working with these commands worked:

1)Unzipped the file -> unzip -q chromedriver_linux64.zip

2)Force the copy to the directory 'usr/bin' -> sudo mv -f chromedriver /usr/bin

The selenium code was something like this:

System.setProperty("webdriver.chrome.driver","/usr/bin/chromedriver");

WebDriver driver = new ChromeDriver();

driver.get("https://mvnrepository.com");

driver.close();

Browse Categories

...