如何通过selenium server独立命令行指定Chrome二进制位置?

TJ.*_*TJ. 10 selenium google-chrome

我使用的是谷歌浏览器的便携版本,该版本未存储在Windows 7计算机的默认位置.我没有管理员权限在默认位置安装Chrome.

运行java -jar selenium-server-standalone-2.52.0.jar -help并不暗示任何设置chrome二进制文件路径的可能性(不是chrome驱动程序).

铬驱动程序的功能表明它是可以设置的二进制,但我不知道如何通过命令行来做到这一点.

bob*_*alf 5

您可以在ChromeOptions中为Chrome二进制文件指定非标准位置。

ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");
Run Code Online (Sandbox Code Playgroud)

请参阅以下ChromeOptions文档:https : //sites.google.com/a/chromium.org/chromedriver/capabilities#TOC-Using-a-Chrome-executable-in-a-non-standard-location