WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Can't run on a remote machine

Open quincycs opened this issue 9 years ago • 68 comments

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."}}

quincycs avatar Feb 11 '17 00:02 quincycs

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.

quincycs avatar Feb 11 '17 12:02 quincycs

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?

dnovikau avatar Feb 13 '17 11:02 dnovikau

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?

svchig avatar Feb 13 '17 12:02 svchig

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.

quincycs avatar Feb 13 '17 17:02 quincycs

Hi @quincycs yes this is important to VSTS integration and we are investigating how to enable running WinAppDriver in such a scenario.

yodurr avatar Feb 14 '17 04:02 yodurr

assigning issue to myself, will update when there is progress to report.

yodurr avatar Feb 14 '17 04:02 yodurr

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

ghost avatar Mar 22 '17 00:03 ghost

Hi Yodurr, any progress on this issue? Thanks!

emie-infotrack avatar Apr 23 '17 23:04 emie-infotrack

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

dhapolapankaj avatar Jun 09 '17 15:06 dhapolapankaj

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

regedit-remotedesktop_suppresswhenminimized

but its not working when I closed the RDP session.

dhapolapankaj avatar Jun 12 '17 09:06 dhapolapankaj

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.

yodurr avatar Jun 12 '17 20:06 yodurr

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

Korop avatar Jun 21 '17 11:06 Korop

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

rameghwa avatar Jul 20 '17 09:07 rameghwa

Anybody here? Any updates on this blocker?

DoCode avatar Oct 02 '17 21:10 DoCode

Hi guys, did you found any workaround for this issue?

dominik1776 avatar Feb 14 '18 20:02 dominik1776

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.

hassanuz avatar Feb 20 '18 23:02 hassanuz

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.

OtherVibes avatar May 06 '18 13:05 OtherVibes

Hi guys! Did you find any workaround for this issue? It is very important(

ant-skelia avatar May 08 '18 11:05 ant-skelia

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

ghost avatar May 25 '18 12:05 ghost

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!

skarzy avatar May 29 '18 15:05 skarzy