简体   繁体   English

WinAppDriver:org.openqa.selenium.SessionNotCreatedException:无法创建新的远程 session

[英]WinAppDriver: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session

I am trying to automate tests in a desktop application developed in Delphi, using WinAppDriver.我正在尝试使用 WinAppDriver 在 Delphi 中开发的桌面应用程序中自动化测试。

  • Programming language: Java 1.8.0_281编程语言:Java 1.8.0_281

  • IDE: Eclipse, Luna Service Release 2 (4.4.2) IDE:Eclipse,Luna 服务版本 2 (4.4.2)

  • selenium-server-standalone-3.141.59.jar selenium-server-standalone-3.141.59.jar

  • Appium: java-client-7.4.1.jar Appium:java-client-7.4.1.jar

  • commons-lang3-3.12.0 commons-lang3-3.12.0

    public class Demo {公共 class 演示 {

     public static void main(String[] args) { WindowsDriver driver = null; DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "<path_of_exe_file>"); capabilities.setCapability("platformName","Windows"); capabilities.setCapability("deviceName", "WindowsPC"); try { driver = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities); } catch (MalformedURLException e) { e.printStackTrace(); } }

    } }

The application starts with an info-splash screen and then main application is launched.应用程序以信息启动屏幕开始,然后启动主应用程序。 However following error is displayed in the console:但是控制台中会显示以下错误:

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session.线程“主”org.openqa.selenium.SessionNotCreatedException 中的异常:无法创建新的远程 session。 Please check the server log for more details.请检查服务器日志以获取更多详细信息。 Original error: Failed to locate opened application window with appId: <path_of_exe_file>, and processId: 1936 (WARNING: The server did not provide any stacktrace information)原始错误:无法找到打开的应用程序 window with appId: <path_of_exe_file>, and processId: 1936 (WARNING: The server did not provide any stacktrace information)

Please let me know, how to solve this.请告诉我,如何解决这个问题。

You may need to install the WinAppDriver.您可能需要安装 WinAppDriver。 And the app id should be the path of the desktop application you want to automate. app id 应该是您想要自动化的桌面应用程序的路径。

I had the same issue multiple times.我多次遇到同样的问题。 The best solution is close all the the applications and restart the machine.最好的解决方案是关闭所有应用程序并重新启动机器。 Then run the winappdriver.exe and execute the test scripts.然后运行 winappdriver.exe 并执行测试脚本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Selenium 3.0 Firefx 驱动程序因 org.openqa.selenium.SessionNotCreatedException 失败:无法创建新的远程会话 - Selenium 3.0 Firefx Driver fails with org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session Appium 错误:线程“main”org.openqa.selenium.SessionNotCreatedException 中的异常:无法创建新的远程会话 - Appium Error :Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。 在模拟器中初始化android驱动程序 - org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. while initializing android driver in emulator org.openqa.selenium.SessionNotCreatedException:无法在Mac中创建新的远程会话 - org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session in Mac org.openqa.selenium.SessionNotCreatedException:无法通过 Selenium 和 Java 使用 GeckoDriver 和 Firefox 创建会话错误 - org.openqa.selenium.SessionNotCreatedException: Unable to create session error using GeckoDriver and Firefox through Selenium and Java org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException:会话未为Chrome创建异常 - org.openqa.selenium.SessionNotCreatedException: session not created exception for Chrome org.openqa.selenium.SessionNotCreatedException:会话未创建断开连接:无法使用 ChromeDriver 和 Chrome 将消息发送到渲染器错误 - org.openqa.selenium.SessionNotCreatedException: session not created disconnected:unable to send message to renderer error with ChromeDriver and Chrome org.openqa.selenium.SessionNotCreatedException:无法找到匹配的功能集 - org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM