I'm using Selenium with Java and executing tests with JUnit. It keeps telling me
cannot find Chrome binary
Binary location is not standard because I need to test multiple versions. I precise that Chrome.exe launcher exists at specified JSON location...
It looks like the driver still searching at the standard location.
I've got the JSON configuration file:
{
"capabilities":[
{
"browserName":"chrome",
"platform":"WINDOWS",
"chromeOptions":{
"binary":"C:/path/chrome_binary.exe"
},
"maxInstance":1
}
],
"configuration":{
"cleanUpCycle":2000,
"timeout":30000,
"register":true,
"hubPort":4444,
"hubHost":"hub.location.net",
"maxSessions":1
}
}
As you can see I'm on Windows so I tried path with slashes and backslashes but it doesn't work in either way.
ChromeOptions object should be okay, I used this official documentation
Command line is:
java -jar selenium-server-standalone.jar -role webdriver -nodeConfig path/to/conf.json -Dwebdriver.chrome.driver=path/to/chromedriver.exe
In the code, I'm creating RemoteWebDriver objects and I'm only passing browser, version and platform. It works well with Firefox. For example in JSON node configuration I've got the firefox_binary set and in code, I don't pass it to DesiredCapabilities. Selenium can still use the remote web driver I launched with the command above.
Thanks !