org.openqa.selenium.remote.UnreachableBrowserException:无法启动新的会话。可能的原因是Winium

时间:2018-10-25 07:04:00

标签: selenium selenium-webdriver webdriver winium

我正在尝试通过Winnium自动化我的桌面应用程序。尝试通过它运行计算器时,我取得了成功,但对于正在使用的应用程序却并非如此。 Winnium无法在端口9999上启动新会话。以下是我遇到的异常:

Exception in thread "main" 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: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'INVA621934', ip: '10.164.31.43', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: WiniumDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
    at org.openqa.selenium.winium.WiniumDriver.<init>(WiniumDriver.java:84)
    at com.fil.behaviourFin.desktop.Calculator.pocFMW(Calculator.java:54)
    at com.fil.behaviourFin.desktop.Calculator.main(Calculator.java:24)

我的代码如下:

public void poc() throws MalformedURLException, InterruptedException{

options.setApplicationPath("C:\\Windows\\System32"+
"\\FundManagerWorkbench_SIT.exe");
driver=new WiniumDriver(new URL("http://localhost:9999") , options);
Thread.sleep(4000);
}

0 个答案:

没有答案