gpt4 book ai didi

java - org.openqa.selenium.WebDriverException : unknown error: DevToolsActivePort file doesn't exist

转载 作者:行者123 更新时间:2023-12-03 01:38:00 25 4
gpt4 key购买 nike

我尝试在远程 PC 上启动电子应用程序,该应用程序作为节点连接到 Selenium 网格。以前它工作正常。但现在我收到此错误“DevToolActivePort 文件不存在”

    System.out.println("launch application in windows PC");     
capa = new DesiredCapabilities();

capa.setBrowserName("chrome");
File file = new File("path\\to\\file\\.exe");
URL server = new URL("http://ip_of_remote_pc:4444/wd/hub");

ChromeOptions options = new ChromeOptions();
options.setBinary(file); //Sets the path to the Chrome executable
capa.setCapability(ChromeOptions.CAPABILITY, options);
driver2 = new RemoteWebDriver(server, capa); //launch the application
System.out.println("launching application in remote PC");
driver2.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
System.out.println("Application launched");

最佳答案

下载 Electron 的 Chrome 驱动程序,或者访问此 https://github.com/electron/electron/releases在这里安装chromedriver就可以了

关于java - org.openqa.selenium.WebDriverException : unknown error: DevToolsActivePort file doesn't exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51034922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com