ChromeDriver: Custom Chrome Executable Path

后端 未结 2 802
忘掉有多难
忘掉有多难 2021-01-01 05:10

I\'m using the portable version of Google Chrome.

Since WebDriver expects the default installation path, it does not find the portable one which obviously is at anot

2条回答
  •  悲&欢浪女
    2021-01-01 05:45

    Nevermind, I found the answer myself:

    ChromeOptions options = new ChromeOptions();
    options.setBinary("/path/to/chrome/binary");
    
    ChromeDriver driver = new ChromeDriver(options);
    

    Chromedriver docs

提交回复
热议问题