简体   繁体   中英

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.

  • Programming language: Java 1.8.0_281

  • IDE: Eclipse, Luna Service Release 2 (4.4.2)

  • selenium-server-standalone-3.141.59.jar

  • Appium: java-client-7.4.1.jar

  • commons-lang3-3.12.0

    public class Demo {

     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. 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)

Please let me know, how to solve this.

You may need to install the WinAppDriver. And the app id should be the path of the desktop application you want to automate.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM