3

I have couple of machines on which I wish to schedule exceutions. I need to access these machines remotely for exceution. Whenever I start exceution from these machines and minimize the session my script fails. So just curious to know whether QTP scripts can be executed while keeping sessions minimized. If yes what changes needs to be made in script. Thanks.

NewAutoUser
  • 533
  • 2
  • 10
  • 26

2 Answers2

6

When 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, the tests are unable to interact with the tested application’s GUI as the GUI doesn’t actually exist in this case.

You need to change Registry keys on your computer (that is, the computer from which you connect to a remote QTP workstation). Here is a step-by-step description:

  1. Close Remote Desktop sessions opened on your computer.
  2. Click Start and select Run. In the Run dialog box, type regedit and press Enter. Registry Editor starts
  3. 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)
  4. Create a new DWORD value in this key named RemoteDesktop_SuppressWhenMinimized. Specify 2 as the value data.

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

This was taken from: http://blog.smartbear.com/post/10-10-11/testcomplete-tip-running-tests-in-minimized-remote-desktop-windows/

Michael Innes
  • 2,045
  • 5
  • 25
  • 41
  • But the request to move the mouse is not going from current machine to the remote machine. The QTP cripts are hosted in the remote machine only. Then why does it create a problem on minimizing the window? – Ashwin Aug 20 '13 at 02:55
1

The problem you're facing is that if you minimize your display the remove machine knows that it doesn't have a display and ignores any questions about control locations and requests to move the mouse. In some cases QTP runs tests using device replay which means that the test will fail.

To work around this you need to have the remote machine think that it still has someone attached to it. One way is (obviously) to not minimize or close the remote desktop session. Another way is to use a remote access program that doesn't inform the remote machine when it's minimized a free example of such program is VNC, if I remember correctly you can even close the VNC session (not just minimize it) and the test will still run successfully.

Motti
  • 110,860
  • 49
  • 189
  • 262
  • @Motti : But the request to move the mouse is not going from current machine to the remote machine. The QTP cripts are hosted in the remote machine only. Then how does minimizing the connection affect what is going on in the remote machine? – Ashwin Aug 20 '13 at 03:01
  • @ashwin it's due to the integration between windows and rdp, rdp tells windows that there is no display and windows acts accordingly – Motti Aug 20 '13 at 19:00
  • @Motti : no, you mean to say that the display in the remote machine gets affected? like it switches off? – Ashwin Aug 21 '13 at 06:34
  • 1
    @Ashwin, when you connect with RDP the physical display (if any, on a VM there is none) gets disconnected and the screen will show the user locked out. When the RDP session is disconnected the physical display is not automatically reconnected and there is no active display attached to the computer. – Motti Aug 21 '13 at 19:58