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 \"Act
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.
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.
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
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:
Stas.