How to specify the Chrome binary location via the selenium server standalone command line?

Issue

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.

Solution

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

Answered By – bobanahalf

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published