【发布时间】:2015-09-28 07:44:03
【问题描述】:
我的 Selenium Web 驱动程序有问题。我想要做的是启动一个“便携式”chrome 而不是我的本地安装,因为它有不同的设置。
问题在于,便携式 Chrome(来自 PortableApps)似乎只有在使用 GoogleChromePortable.exe 时才能启动。如果我直接使用 Chrome 二进制文件,它将开始我的本地安装。 使用 Selenium,似乎无论我传递给它的 Chrome 路径(GoogleChromePortable.exe 还是二进制路径),它都会启动我的本地安装。
这是我的代码:
String chromePath = "M:/my/path";
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
capabilities.setCapability("chrome.binary", chromePath);
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
任何想法如何能够启动我的便携式 chrome? 谢谢
【问题讨论】: