Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does WinAppDriver.exe close immediately?

I have been struggling to get anything working with WinAppDriver. It's a way of using Selenium to to test window applications.

As per the instructions below, I have installed WinAppDriver. When you run it, it should stay open in a command window. Mine does not stay open however and that is the problem.

My Question is why does WinAppDriver close immediately when I navigate to "C:\Program Files (x86)\Windows Application Driver" and run WinAppDriver.exe? I have tried right clicking and choosing "Run as administrator" and the same thing happens.

I have spoken to IT support and they checked that anti virus wasn't blocking it.

The demo video I am following is here and WinAppDriver is installed from here and it needs to be running. When running it opens a CMD window which says Window Application Driver listening for requests at: http://127.0.0.1:4723/ Press ENTER to exit..

You can see in the video at about 5:30, they launch WinAppDriver.exe and the CMD window opens and stay open. What possible reasons are there that mine closes immediately?

Installing and Running Windows Application Driver

1.Download Windows Application Driver installer from https://github.com/Microsoft/WinAppDriver/releases

2.Run the installer on a Windows 10 machine where your application under test is installed and will be tested

3.Run WinAppDriver.exe from the installation directory (E.g. C:\Program Files (x86)\Windows Application Driver)

like image 372
Ewan Avatar asked Dec 13 '22 14:12

Ewan


2 Answers

The answer in my case was to set "Developer Mode" in Windows 10. Just go to the Start menu and type "Use Developer Features". Set "Developer mode" to On and agree to the instal etc. Nobody told me this stuff in the tutorials...

like image 158
Ewan Avatar answered Dec 22 '22 02:12

Ewan


Another reason might be that you already have Appium server running in the background on the same port. To be sure, open cmd.exe first and paste the link to WinAppDriver.exe, then press "Enter".

like image 42
askepott Avatar answered Dec 22 '22 02:12

askepott