[HowTo] Windows: use Remote Desktop minimized without stopping script on remote machine

Asked by Lorien

**************** solution

see comment #2

-------------------------------------------------------

So I know a lot of questions have been asked about using Sikuli via remote desktop, but a lot of that revolves around whether you can run it on a headless machine, etc. I have Sikuli installed on office computer and I'd like to remote desktop onto my office computer from home and start my sikuli program (i.e. I'm simply telling the sikuli program that is already on my office computer to start). This works well if I keep the remote desktop screen always open on the computer that I am remoting from, but if I switch screens to work on something else, sikuli stops working on my office computer. Even if I pull my mouse to the side of the screen so it's no longer above the remote desktop image it's as if my office machine no longer has a mouse and can't perform any of the clicking functions etc. I've tried looking this problem up for remote desktop in general but I can't find answers. I'm sure there's a simple solution (after all, sikuli works just fine on the office computer if I don't remote in!) so I'm not certain why this would be such a problem. Any help would be appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Tommy Gregersen
Solved:
Last query:
Last reply:
Revision history for this message
j (j-the-k) said :
#1

Which program do you use for your remote desktop screen?
A remote desktop viewer like vnc should normally not have any influence on the sikuli script running on the remote machine.
All Sikuli needs is a graphical desktop on the machine it runs on and it does not know and not care which remote connections to this desktop exist.

I suppose you use windows RDP which has the kinds of problems you're describing ( see comments in https://answers.launchpad.net/sikuli/+question/185791)
It is recommended to use VNC instead of RDP for remote connections to machines running Sikuli.

Revision history for this message
Best Tommy Gregersen (n08k) said :
#2

Running Tests in Minimized Remote Desktop Windows:

The Microsoft Windows operating system includes the Remote Desktop component that allows you to connect to a remote computer and work with it as with your local computer. This is a common way to run and monitor automated tests on remote computers: you connect to the test computer using a Remote Desktop Connection (RDC) and use the Remote Desktop window to work with the remote computer on your PC.

There is a pitfall using this scenario: you may not minimize the Remote Desktop window (that is, the window which displays the remote computer’s desktop), or your GUI tests will fail. If you minimize this window, the operating system switches the remote session to a GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) are unable to interact with the tested application’s GUI as the GUI doesn’t actually exist in this case.

Keeping the Remote Desktop window visible may be inconvenient, as it will occupy some part of or even your entire screen, and you will have less space for running your local applications.

We have found a way to bypass this limitation. The workaround is simple: you need to change Registry keys on your computer (that is, the computer from which you connect to a remote TestComplete or TestExecute workstation). Here is a step-by-step description:

Close Remote Desktop sessions opened on your computer.

Click Start and select Run. In the Run dialog box, type regedit and press Enter. The Registry Editor starts.

Locate any of the following Registry keys:

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\

(if you want to change the RDC settings for your user account)
-- or --

HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\

(if you want to change the RDC settings for all accounts)

Create a new DWORD value in this key named RemoteDesktop_SuppressWhenMinimized. Specify 2 as the value data.

That’s all. Now minimizing the RDC window on your computer will not affect the remote computer’s GUI and the GUI will still be available to your automated GUI tests.

source: http://blog.smartbear.com/software-quality/bid/169972/?printable=1

Revision history for this message
Lorien (sticelaw) said :
#3

Thanks, this is perfect!

Revision history for this message
Priyabrata Mohanty (uprince) said :
#4

I tried the same on my windows machine.

Added the registry keys and executed sikuli script from Jenkins.

But this did not work when i minimized the Remote Desktop. Is your suggession works for Sikuli Scripts?

Thanks for your understanding.