Selenium Grid: set chrome *binary* path

被刻印的时光 ゝ 提交于 2019-12-12 12:44:46

问题


Note: I am not asking about setting the path of the chromedriver.

I want to run a Selenium node with a specific version of Chromium as opposed to the default Chrome installed on the system. The webdriver doc says I would need to pass a ChromeOptions object, but this is obviosuly impossible to do on the command line.

I've tried manually adding a JSON that represents ChromeOptions to the command line (like below), but it does not have any effect.

java.exe -jar selenium-server-standalone-2.47.1.jar -role node -hub http://localhost:4444/grid/register -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=5,chromeOptions={binary:./chromium/chrome.exe} -Dwebdriver.chrome.driver=chromedriver.exe

(I've tried all different ways of quoting the JSON, but it is simply not used.)


回答1:


What has not been made clear in the bug filed for this nor the documentation is that a new capability key "chrome_binary" has been added to specifically support this. See commit 41a9d29.

This key can be used in the -browser argument used to start a node and the node will build the ChromeOption for you.



来源:https://stackoverflow.com/questions/33078901/selenium-grid-set-chrome-binary-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!