Can't run on a remote machine
I was trying to run this on a machine that isn't connected to a monitor (e.g. its a virtual machine). When a session tries to start and you aren't connected to the computer with a remote desktop connection then an error is produced. If the same code runs and you are connected at the time with a remote desktop connection then there is no error.
My guess would be that windows app driver can't launch an app when a PC is inactive. Below is what the console shows.
I've also reproduced this when code runs and tries to open a new session on my laptop (a non-remote machine) while it's locked (windows key + L).
========================================== POST /session HTTP/1.1 Accept: application/json, image/png Connection: Keep-Alive Content-Length: 124 Content-Type: application/json;charset=utf-8 Host: 127.0.0.1:4723
SessionManager - Creating session SessionManager - WinAppDriver succeeded loading MitaBroker HTTP/1.1 500 Internal Error Content-Length: 133 Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
Please fix this. I feel like this scenario is the only way to really run this tool in an automated way. This will need to be fixed before any VSO integration I would think.
We faced with the same issue on a physical machine when there is not active remote connection. Can propose any workaround until issue is fixed?
The same problem. The tests are executed if session open on remote workstation. The tests are not executed if session closed. We tried to run WinAppDriver.exe as administrator but it doesn't help. Could you advise any workaround until issue is fixed?
Currently what I do is have a computer under my desk always on. This computer always has a remote desktop connected and I turn off lockscreen.
Hi @quincycs yes this is important to VSTS integration and we are investigating how to enable running WinAppDriver in such a scenario.
assigning issue to myself, will update when there is progress to report.
Hi Yosef, I'm facing the same issue and its really critical as I've proposed and used this to automate the desktops apps in my organization. I have integrated my tests with teamcity. But, the test only runs if I'm logged into the agent machine and keep my session active. Would be of great help if you can resolve the same, soon. Thanks, Francis
Hi Yodurr, any progress on this issue? Thanks!
Hi @yodurr Sorry to bother. Do we have any thing to share an update on resolving this issue?
Do you think we can an additional layer between the actual windows desktop and the WinAppDriver. This layer will be mirroring the actual windows desktop applications and when we try to get a desktop object or any application object WinAppDriver will be able to control the contents of this mirrored layer. After the operation is finished the actual Windows desktop application will be updated with real content of the mirrored layer. Does that make sense?
Regards PD
Hey @quincycs
I was able to try below solution when screen is minimized or closed
Added a DWord ""RemoteDesktop_SuppressWhenMinimized"" with Value 2 at below location
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client
refer below screenshot
Add this in the Desktop machine from where you have started the RDP session and not in VM

but its not working when I closed the RDP session.
Hi @dhapolapankaj mirroring isn't something we plan on supporting right now. You need to maintain an interactive session, which is why the RDP session needs to stay up during the test.
We run Win10 UWP UI test on virtual machine. To avoid app "hang" when close RDP session we use command script logout-rdp.bat. Create a shortcut for it and run as administrator when want to logout from the virtual machine
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
C:\Install\QRes.exe /x 1920 /y 1080
)
If you need resolution other than default you your IT should manage virtual machine Display settings to allow the required resolutions. I also used VNC server to manage the resolution of 0-console session as we have to support different resolution testing.
See more details on https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/keeping-computer-unlocked.html
@yodurr Is there any update on this issue. I want to integrate my UWP app tests written using WinAppDriver to VSO. Currently I have to keep the remote desktop window open.
Anybody here? Any updates on this blocker?
Hi guys, did you found any workaround for this issue?
Hi @DoCode, @rameghwa, @dominik1776,
We recommend the agent to be setup as Interactive so that RDP isn't necessary. We're actively working on documentation to address these issues.
Hi, I'm working on a new project that involves AWS as part of the tested product. It appears that Amazon do not provide any access other than RDP, so I currently unable to automate our native app in the cloud. Selenium offers solution called "headless browser" I wonder if such solution can be implemented in WinApp driver.
Hi guys! Did you find any workaround for this issue? It is very important(
Hi all,
Has anyone managed to get this working?
I've tried running WinAppDriver as a service and making that service interactive but this still doesn't solve the issue.
Thanks,
Ben
Hi @hassanuz,
We need to make some decisions about whether to invest a lot of development effort into using WinAppdriver, but it is blocked by this issue. can you give us an update on the following points?
You say :
We recommend the agent to be setup as Interactive so that RDP isn't necessary
Can you expand on this? Our requirement is simple, we just want to run some UI automation in a build without having to sit watching it. Any suggestions would help.
Also, when you say you are:
working on documentation to address these issues
Does that mean, documenting workaround approaches we can use, or documenting how you aim to fix it in future releases?
Thanks!