使用Selenium WebDriver无法在Windows 10上启动Edge浏览器

时间:2019-02-14 19:16:01

标签: java selenium-webdriver microsoft-edge

我无法使用以下代码在Windows 10上启动Edge浏览器。请帮忙。

@SuppressWarnings("deprecation")
private WebDriver getEdgeDriver() {  
    DesiredCapabilities caps = DesiredCapabilities.edge();
    caps.setCapability("EnableNativeEvents", false);
    caps.setCapability("ignoreZoomSetting", true);
    caps.setCapability("requireWindowFocus", true);
    caps.setCapability("enablePersistentHover", true);
    logger.info("***Prepare EDGE [Driver] : [" + getEdgeEXE() + "]"); 
    System.setProperty("webdriver.edge.driver", getEdgeEXE());
    caps = DesiredCapabilities.edge();
    return new EdgeDriver(caps);
    //return capabilities.edge();
}

运行时,我得到以下信息:

Feb 14, 2019 2:33:04 PM org.openqa.selenium.remote.DesiredCapabilities edge
INFO: Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
Feb 14, 2019 2:33:25 PM org.openqa.selenium.os.OsProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: -1073741512 (Exit value: -1073741512)

0 个答案:

没有答案