0

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.

Lawrence
  • 29
  • 1
  • 6

2 Answers2

0

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

Sonali Das
  • 943
  • 1
  • 7
  • 24
  • I had the WinAppDriver installed and was running. I had used the "app" value correctly. FYI, notepad.exe works correctly for me. – Lawrence Apr 08 '21 at 04:34
  • Are you manually able to invoke the app by clicking on the exe file. Also did you check in taskmanager if winapp driver had invoked the app and the process is running in task manager for that app. sometimes kill all the process related to app or restart the system help – Sonali Das Apr 08 '21 at 08:00
  • Not only manually, the application is started automatically also. The only issue is: it is not opened automatically. It is still available in the task bar. I have to open it manually. – Lawrence Apr 15 '21 at 11:54
0

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.

Murali
  • 31
  • 1
  • 5