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

I am using a portable version of Google Chrome, which is not stored in the Windows 7 folder by default. I don’t have administrator privileges to install Chrome by default.

Running java -jar selenium-server-standalone-2.52.0.jar -help does not indicate the possibility of setting the path to the chrome binary ( not the chrome driver ).

The chrome features indicate that you can install binary , but I'm not sure how to do this through the command line.

+5
source share
4 answers

You can specify a custom location for 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

0
source

You can also use:

 DesiredCapabilities capability = DesiredCapabilities.chrome(); capability.setCapability("chrome.binary","/path/to/chromedriver.exe); driver = new ChromeDriver(capability); 

from org.openqa.selenium.remote.DesiredCapabilities

0
source

After many attempts, I found a configuration such as (scroll through the code window to find the chrome_binary property)

For Windows environment

 java -jar selenium-server-standalone-2.52.0.jar -role webdriver -Dwebdriver.chrome.driver="\path\to\chromedriver.exe" -browser "browserName=chrome,version=__version__,maxinstance=__no__,platform=WINDOWS,chrome_binary=\path\to\chrome\binary\chrome.exe" -hubHost __address__ -port __port__ 

works like a charm

0
source

The quick way that you should put your chrome pointer in your selenium-server-stand-alone-2.52.0.jar is the same folder .

Example: XXX folder will contain jar and exe driver

-1
source

Source: https://habr.com/ru/post/1244369/


All Articles