Selenium Grid:设置 chrome *二进制* 路径

Selenium Grid: set chrome *binary* path

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

我想 运行 一个带有特定版本 Chromium 的 Selenium 节点,而不是系统上安装的默认 Chrome。 webdriver doc 说我需要传递一个 ChromeOptions 对象,但这显然不可能在命令行上执行。

我试过在命令行中手动添加一个代表ChromeOptions的JSON(如下所示),但没有任何效果。

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

(我已经尝试了所有不同的方式来引用 JSON,但它根本就没有被使用。)

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中没有说清楚的地方。

此密钥可用于启动节点的 -browser 参数,节点将为您构建 ChromeOption