WinAppDriver
WinAppDriver copied to clipboard
Having to manually start WinAppDriver before Azure Pipeline runs a test
Hello,
Currently before I run the Azure pipeline for my automated test of a Windows client I need to start WInAppDriver manually on the VM. We have tried using a scheduler and that has not work. Since we are trying to have the test run on a schedule having someone need to start WInAppDriver.
If I don't start WinAppDriver I get the error, "Unable to connect to the remote server --> System.Net.Sockets.SocketException: No Connection could be made because the target machine actively refused it.
The first thing the code does is check to see if the port is open and if it is not open it tries to start WinAppDriver. The error comes from checking to see if the port is open. When I run this code from the command line on the VM it runs without an issue.
Should I be focused on opening WinAppDriver on the server or trying to open it from the pipeline?
TIA, John
Please follow the doc
I followed the steps but I'm still having an issue. I see the WinAppDriver task open but it is running in the background. When I run the pipeline after I start it manually it works. Do I need to force it to the foreground and if so how?
I followed the steps but I'm still having an issue. I see the WinAppDriver task open but it is running in the background. When I run the pipeline after I start it manually it works. Do I need to force it to the foreground and if so how?
The task is running WinAppDriver in the background. Could you add a post here WinAppDriver logs from the second task when you stop WinAppDriver? Also, post the error that you got in youк test.
The error I'm getting from my test is " System.InvalidOperationException : Failed to locate opened application window with appId "
Below is what I see in the pipeline when starting WinAppDriver, not sure if this is what you're looking for. I didn't see anything in the Eventviewer on the server. Setting display resolution on Agent to - 1080p Launching WinAppDriver with 127.0.0.1:4723 WinAppDriver launch successful. Finishing: WindowsApplicationDriver
Does your application have splash screen?
Yes it does. Before the splash screen appears there is a popup which has the status of checking for a new version of the application.
Then you need to create a root session and jump to the open window, which language binding are you using?
if C# see #1341 if python check #1646
I have sort of the same problem.
- I have a self hosted build pipeline in Azure Devops in which I have a standard start and stop task for WinAppDriver enabling a graphical test.
- When WinAppDriver is already running the test depending on it succeeds (on an empty screen).
- When not, the starting does not succeed, and obviously the test fails.
- In both cases there is some red text displayed in the startup window. But I was not able to read or catch the text.
- The normal Azure log window does not show any problems.
This used to work for me. I hadn't used this for a while, so a lot may have changed.
Questions
- Is there a way to read or catch the output from the starting step?
- Anything that may need to change in my setup?
- Bug?
@a-einstein Could you provide a code example and error that you got from the test? Maybe the test cannot create the session during starting of the app.
Same problem for me. Everything works when I starts WinAppDriver manually using RDP to remote machine.
With pipeline instruction:
- task: Windows Application Driver@0
inputs:
OperationType: 'Start'
is just not being started and UI tests crashed because of unable to connect error.
If I run WinAppDriver manually before running pipeline then my tests run successfully
Also interesting thing that my pipeline contains task with WinAppDriver Stop operation but this successfully closes my manually run WinAppDriver session
Then you need to create a root session and jump to the open window, which language binding are you using?
@anunay1 Can it still be a splash screen issue if it works when I start WinAppDriver manually?
@Shakevg here is the error
Then you need to create a root session and jump to the open window, which language binding are you using?
@anunay1 Can it still be a splash screen issue if it works when I start WinAppDriver manually?
@Shakevg here is the error
Are you starting the test agent in admin mode?
Same problem for me. Everything works when I starts WinAppDriver manually using RDP to remote machine.
With pipeline instruction:
- task: Windows Application Driver@0 inputs: OperationType: 'Start'
is just not being started and UI tests crashed because of unable to connect error.
If I run WinAppDriver manually before running pipeline then my tests run successfully
Also interesting thing that my pipeline contains task with WinAppDriver Stop operation but this successfully closes my manually run WinAppDriver session
Are you starting the test agent in admin mode?
@anunay1 the account I'm using has admin access on the VM. Is there something I can check to confirm it is in admin mode?
Have you not installed any test agent in your VM? When you start winappdriver.exe manually, do you start it as an admin?
@anunay1 yes when I run it manually I start it as an admin. When opening Winappdriver through the pipeline I see it running in the background and instances of my application opening in the background as well.
Oh ok then it's not starting in admin mode? Also what is the log that you get the pipeline for the winappdriver task?
@anunay1 it says it is successful.
I have tried to put in a delay before it looks for the exe but that didn't solve anything. It's opening additional instances of the application because it can't find the ones open earlier.
@anunay1 The code is looking for the Window and when I do a check for any windows being open and it turns out there are no Windows open. I believe this is because the processes are in the background.
My application keeps opening new instances of the application and I check for a Window and the code returns that there are no Windows open even though I can see the process in the Task Manager. The application we are testing has a menu selection screen after the drop down. Once you get past the menu selection screen then the application goes to the task bar.
Will it be possible to have a teams call?
@anunay1 yes I can. I'm in the US EDT time zone. How can I get you my contact information.
The contact info is there in the profile. You can schedule it around 8PM IST.
@anunay1 I sent you an email from my yahoo account.
Did not receive any mail? Can you send to [email protected]