I am using a portable version of Google Chrome that is not stored at the default location of my Windows 7 machine. I don't have admin rights to install Chrome at the default location.
Running java -jar selenium-server-standalone-2.52.0.jar -help
does not hint any possibility of setting the path to the chrome binary (not the chrome driver).
The chrome driver capabilities indicate that it's possible to set the binary but I'm not sure how to do it via the command line.
ChromeOptions optionsBeta = new ChromeOptions(); optionsBeta. setBinary(“path\\to\\chrome\\browser\\beta\\binary”); WebDriver driver = new ChromeDriver(optionsBeta);
What is the exact path to the chrome binary on your PC? If you are working on Windows 10, it would be C:\Program Files (x86)\Google\Chrome\Application\chrome.exe .
Go to the terminal and type the command: sudo nano /etc/paths. Enter the password. At the bottom of the file, add the path of your ChromeDriver. Type Y to save.
You can specify a non-standard location for the chrome binary in ChromeOptions.
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");
See the ChromeOptions documentation at: https://sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-Using-a-Chrome-executable-in-a-non-standard-location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With