open Remote Desktop Connection required?

Ask general questions here.
sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

open Remote Desktop Connection required?

Post by sergii » Thu Feb 26, 2015 9:54 pm

I'm having very simple test that cannot be executed in Amazon Web Services box without currently open RDC session.
I'm using Only Code Modules (no recordings) and repo saved items.


Local environment: Run manually - success.
Remote AWS box (with opened RDC): Run EXE manually - success.
Remote AWS box (with opened RDC): EXE triggered by scheduled call from Bamboo - success.
Remote AWS box (with closed RDC): EXE triggered by scheduled call from Bamboo - failed.

I can see black screen on all screenshots (internationally taken and exception triggered).
Browser seems to be in the same state after I reconnect to the AWS box, while minority of clicks seems to success (I suspect that ranorex might be clicking in [0,0] canvas position as it sometimes do, when some elements are not found, but majority of object clicks result in "Failed to find item".
Attachments
bamboo_reports.7z
(332.82 KiB) Downloaded 54 times

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: open Remote Desktop Connection required?

Post by krstcs » Fri Feb 27, 2015 2:44 pm

Ranorex is a User Interface automation tool.

Without a REALIZED desktop, there is no UI so Ranorex can't find anything.

You must have a REALIZED desktop, either RDP or VNC or local console for Ranorex to work.

The desktop also can NOT be locked.

This is a Windows Security feature and there is no way to work around it (for Ranorex or any other UI automation tool).
Shortcuts usually aren't...

sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

Re: open Remote Desktop Connection required?

Post by sergii » Fri Feb 27, 2015 8:42 pm

Thanks a lot.
Don't remember it have been mentioned anywhere in documentation or best practices.

Just found another topic about this.
When you log on to the remote computer via the Remote Desktop Connection client, the remote computer becomes locked preventing other users from accessing it. If you close the remote desktop connection client and disconnect from the remote desktop session, the remote computer will remain locked and the user session on the remote computer will run in the GUI-less mode and not display windows and controls.

In other words, if your automated test needs to interact with the GUI, do not disconnect from the Remote desktop session while the test is running, otherwise the test will fail.

As a workaround you can disconnect from the Remote Desktop session and retarget the session to the remote computer’s console. In that case the session on the remote computer will be unlocked allowing your automated test to interact with the GUI.
Alternatively you can open RDC every 24 hours and minimize it. After making some changes to HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client your tests should be running smoothly with connected, but minimized RDC.

Hopefully this thread will prevent somebody from stepping in same mistake as I did.