我正在尝试使用 Java Selenium 启动 Edge 浏览器:
if(browser.equals("edge")) {
System.setProperty("webdriver.edge.driver", driverPath+"\\MicrosoftWebDriver\\MicrosoftWebDriver.exe");
driver = new EdgeDriver();
}
但我有这个例外:无法开始新会话。可能的原因是远程服务器地址无效或浏览器启动失败。
[11:25:55.747] - Listening on http://localhost:25602/
[Ljava.lang.StackTraceElement;@4d98e41b
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'EB00477', ip: '192.168.6.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.1'
Driver info: driver.version: EdgeDriver
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'EB00477', ip: '192.168.6.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.1'
Driver info: driver.version: EdgeDriver
我的 Edge 版本是:Microsoft Edge 44.18362.449.0,Microsoft EdgeHTML 18.18363
我尝试同时使用MicrosoftWebDriver.exe
和msedgedriver.exe
文件,它们不起作用。我怎样才能让它工作?