Running Coded UI test remotely
Asked Answered
I

4

10

I have to run Coded UI test remotely on a VM. I am using Mstest.exe to execute the test cases. Now when i run it , through Windows scheduler , it fails because it need "Active Desktop ".

I read it a few places that we need to use test agent. But i dont want to configure test agent and test controller just to set "Active desktop", Is their something else that i can do ?

Imbue answered 17/4, 2012 at 15:0 Comment(0)
R
13

Well there is no hard in setting up a test controler and a test agent, it is really easy and its the best way to go. You can find the installation guidelines here: http://msdn.microsoft.com/en-us/library/dd293551.aspx

However, there are few issues that still exist even when you use a controller.

The Test Agent can run in either Service or Process mode. For coded ui test you need to run it in a process mode (because it needs to be in the same windows session). But when you log into VM, with Remote Desktop, and close it, the Desktop of the target machine stays locked and tests cannot proceed. And unless you log in, there is no active session and test controler doesnt even get started.

There are 2 ways to keep an active desktop that i know of:

  1. (recommended) Run AutoLogOn.exe from sysinternals suite (can be found at http://live.sysinternals.com/). It will automatically log in with specified user than the machine starts, and keep the desktop active.
  2. Keep a remote desktop in a non minimized window active. There are few applications that you can find that can keep multiple remote desktop's open, and keeping it connected should do the trick.

Stas.

Reductase answered 22/5, 2012 at 13:30 Comment(0)
H
0

You need to do the following things:

1) Set Auto Log On.

2) Disable the screen saver.

3) Disable all the thing that should disturb to the tests, for example: shutdown the windows update.

Hurtle answered 19/5, 2014 at 12:0 Comment(0)
E
0

RUN THE CODEDUI TESTS ON VIRTUAL MACHINES(EVEN WHEN VIRTUAL MACHINES ARE IN MINIMIZED STATE), AND WORKING SIMULTANEOUSLY ON VIRTUAL MACHINES AND ON LOCAL MACHINE DO AS FOLLOW.

1) Close all the Remote Desktop sessions opened on your computer.

2) In your local machine click Start and select Run. In the Run dialog box, type regedit and press Enter. The 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)

Right click on the 'Terminal Server Client' and select 'New' ---> 'DWORD Value' ---> Give the name as ---> RemoteDesktop_SuppressWhenMinimized. ----> Right click on this name and select 'modify' ---> In the popup enter the 'Value data' as '2'

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.

Extinction answered 29/2, 2016 at 13:44 Comment(0)
O
-1

You cannot run the CodedUI tests via a normal RDP connection - you need to log on to a Console session. Assuming the machine on which you would like to run the tests is a Hyper-V machine, you can use the Hyper-V Virtual Machine Manager to log on to the the Console session. In some instances, running Remote Desktop with the /admin parameter may work (but it hasn't for me):

mstsc -v:SERVERIP -admin
Oracular answered 19/8, 2013 at 13:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.