Selenium doesn't launch portable chrome, but local installation

I have a problem with the Selenium web driver. What I'm trying to do is run a β€œportable” chrome instead of a local install, as it has different settings.

The problem is that portable Chrome (from PortableApps) seems to only start when using GoogleChromePortable.exe. If I use only Chrome binary, it will start my local installation. With Selenium, it seems that no matter which Chrome path I pass to it (GoogleChromePortable.exe or the binary path), it launches my local installation.

Here is my code:

String chromePath = "M:/my/path"; DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); capabilities.setCapability("chrome.binary", chromePath); capabilities.setCapability(ChromeOptions.CAPABILITY, options); 

Any ideas on how to start my portable chrome? Thanks

+5
source share
3 answers

For someone who stumbled upon this problem, here's how I managed to launch portable Chrome:

 ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setBinary(binaryPath); driver = new ChromeDriver(chromeOptions); 
+2
source
  String chromePath = "M:/my/googlechromeporatble.exe path"; String chromedriverpath="M:/my/chromedriver.exe path"; ChromeOptions options = new ChromeOptions(); options.setBinary(chromepath); System.setProperty("webdriver.chrome.driver",chromedriverpath); driver = new ChromeDriver(options); 

This will cause a chrome transfer, not a local installation. Set google chrome portable path first, then call chromeriver.exe

+1
source

Depending on the settings you have in ChromePortable, maybe you can use ChromeDriver with Features and ChromeOptions by default ?

I think, especially on the custom profile . If you can somehow get this from your ChromePortable and load it using ChromeDriver by default?

EDIT: Maybe this can help

0
source

Source: https://habr.com/ru/post/1232431/


All Articles