1

我尝试使用以下代码运行电子应用程序:

@Test
public void testElectron() {
    System.setProperty("webdriver.chrome.driver", chromeDriverPath);
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.setBinary(this.electronPath);
    WebDriver driver = new ChromeDriver(chromeOptions);
}

但我收到以下错误:

Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 37592
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: session not created: This 
version of ChromeDriver only supports Chrome version 87
Current browser version is 80.0.3987.165 with binary path src\main\resources\electron\electronApp.exe

是否有适用于电子应用程序(用于 selenium java)的特定 chromedriver?

4

1 回答 1

1

此错误消息...

Current browser version is 80.0.3987.165 with binary path src\main\resources\electron\electronApp.exe

...暗示Chrome浏览器版本是80.0


解决方案

因此,作为解决方案,您必须 从ChromeDriver v80.0.3987.106存储库下载匹配的ChromeDriver

于 2020-12-21T22:07:33.083 回答