我有一個Selenium網絡驅動程序的問題。我想要做的是啓動一個「便攜式」鉻代替我的本地安裝,因爲它有不同的設置。硒不啓動便攜式鉻但本地安裝
問題是便攜式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);
任何想法如何能夠啓動我的便攜鉻? 謝謝