How to Implement Chromedriver in Selenium in Linux Platform
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...
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/chromedriver");
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)
5 Answers
From [the official documentation](:
Requirements
The ChromeDriver controls the browser using Chrome's automation proxy framework.
The server expects you to have Chrome installed in the default location for each system:
OS Expected Location of Chrome ------------------------------------- Linux /usr/bin/google-chrome Mac /Applications/Google\ Chrome Windows XP %HOMEPATH%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe Windows Vista C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exeFor Linux systems, the ChromeDriver expects
/usr/bin/google-chrometo be a symlink to the actual Chrome binary. See also the section on overriding the Chrome binary location.