是否可以使用便携式 chrome 在 win 10 上运行 chromedriver?

Is it possible to run chromedriver on win 10 using portable chrome?

提问人:Alex Blade 提问时间:9/25/2023 更新时间:9/25/2023 访问量:29

问:

我有全新的 win 10 pro PC。没有任何 Google Apps,也没有任何蓝牙卡/设备。 我已经从 portableapps.com 安装了最后一个 Intelij IDEA + chromedriver + chromeportable

当我运行我的代码(作为管理员)时

        System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.setBinary("D:\\Program Files\\ChromePortable\\ChromePortable.exe");
        options.addArguments("--user-data-dir=d:\\Documents\\Temp\\"); // If I comment this I get sandbox error
//        options.addArguments("--disable-features=WebBluetooth");
//        options.addArguments("--headless"); // Run Chrome in headless mode
//        options.addArguments("--no-sandbox");
 
        // Create a WebDriver instance with the specified options.
        WebDriver driver = new ChromeDriver(options);
 
        // Navigate to Google.
        driver.get("https://www.gmail.com/");

我收到错误

DevTools listening on ws://127.0.0.1:51790/devtools/browser/43cdaac2-0bcb-4785-ad8f-b6a8717d0657
[3884:10284:0922/175934.295:ERROR:device_event_log_impl.cc(215)] [17:59:34.295] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.

当我在没有管理员权限的情况下运行时,出现错误

Failed to grant sandbox access to network context data directory D:\Program Files\ChromePortable\Data\profile\Default\Network: Access is denied. (0x5)

PS:当我在win 7上具有相同的配置时,我可以轻松运行chromedriver

在有管理员和无管理员的情况下运行。 使用和不使用参数选项运行

java windows selenium-webdriver selenium-chromedriver 可移植性

评论


答: 暂无答案