remote desktop locking VM on exit
-
Thursday, May 03, 2012 1:57 PM
I'm trying to run Coded UI tests in a Virtual Environment. I have the build and deploy parts working just fine. The issue that I have is that I need to have a remote desktop session open to the Windows 7 Client machine in order for the Coded UI tests to run. I have our test user set to auto login. I've read a few solutions to try but none of them work.
Solution #1: create a bat script with the following in it: tscon %sessionid% /dest:console
This doesn't work because it's a VM and doesn't have a console
Solution #2: Login using the VMConnect on the VM host and keep that session open.
While this would work for a time, I don't have access to the VM host. I need to be able to login directly to the VM to debug problems, view logs and there are several of us on the team that will be monitoring things. It doesn't make sense for use to lockup the VM host in order to debug problems and a VM machine
What I'm looking for is a way for TFS or Test Agents to log on to the machine, create a Desktop session so Coded UI tests can bring up the IE and then execute my tests. I don't want to have to log in to the machine with remote desktop every time I run these test, leave a remote desktop session open or other wise jury-rig a string of Remote Desktop session.
- Moved by Tony xiaoModerator Monday, May 07, 2012 2:36 AM (From:Visual Studio UI Automation Testing (includes CodedUI))
All Replies
-
Thursday, May 03, 2012 2:23 PM
Also for got to mention that I use both the remote desktop application in window and also use the remote desktop inside of Test Manager.
-
Friday, May 04, 2012 3:13 AMModerator
Hi AdamMDavis,
In order to get a clear point of this issue, I would like to know :
- If this CUIT managed by TFS?
- Which template do use in this issue?
- Have you install the test agent and configure as Interactive process in VM?
Tony Xiao [MSFT]
MSDN Community Support | Feedback to us
-
Friday, May 04, 2012 1:31 PM
My Answers to your questions are below.
1. Yes this is Coded UI test that are kicked off my TFS on a Virtual Machine using the Test Agent
2. I don't understand what a "template" is. Can you give me more information so I can answer this question
3. Yes we have installed the Test Agent and configured if for Interactive Process.
-
Friday, May 04, 2012 3:21 PM
I am having the same problem, except that my RDC is to another of our machines. I have to use RDC to remote into the testing machine that has Visual Studio Ultimate. I have 8 tests list that I am trying to get to run 10 times each over night. Last night I set it to run, but they all failed because of the RDC. Here is the error message I received:
Error calling Initialization method for test class ESLAutomationTest.CanadaESLOneWayReservation: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: Automation engine is unable to playback the test because it is not able to interact with the desktop. This could happen if the computer running the test is locked or it’s remote session window is minimized.
I would really like to have them run on this testing machine at night while I am sleeping, instead of sitting here watching them run while I could be doing other things. I'll be keeping a close eye on this post for a possible answer before posting my own.
-
Monday, May 07, 2012 2:32 AMModerator
Hi AdamMDavis,
Seems like this issue is related with lab management, I will move this thread to corresponding forum for better support.
Best Regards,
Tony Xiao [MSFT]
MSDN Community Support | Feedback to us
- Edited by Tony xiaoModerator Monday, May 07, 2012 2:36 AM
-
Tuesday, May 08, 2012 5:59 AMModerator
Hi AdamMDavis,
Based on your above description, it seems that you would like to run Coded UI tests in MTM with virutal environments. And as far as I know that in order to run automated tests in the MTM, you need to set up envrionemt, test settings, and builds. And the test role you specify in the envrionment should be extractly match that in the test setting file. For further information, please see:
http://blogs.msdn.com/b/mathew_aniyan/archive/2009/05/26/coded-ui-test-from-microsoft-test-lab-manager.aspx http://msdn.microsoft.com/en-us/library/dd553270.aspx
And according to this MSDN article:
If you are running tests that interact with the desktop, you must log on to the virtual machine that is used as the role to run tests in your environment to start the interactive process for the test agent. Until you log on to the machine, the testing capability is not enabled.
So I am afraid you need to log on to the virtual machine in order to run the Coded UI tests.
Thanks.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Vicky SongModerator Monday, May 14, 2012 10:20 AM
-
Tuesday, May 08, 2012 1:15 PM
Hello, I work with Adam and am the TFS admin here, and I have to add that we do log into the machine. In fact the machine & the account is configured so that it auto logs in, and never logs out or screen locks or screensaves. So the user IS logged in.
However, for some reason when Adam uses MTM and views the Win 7 client VM, he sees that its logged in, however, when he exits or closes MTM, that action locks the Win 7 client VM (you have to hit "Ctrl+Alt+Del" and relog in).
HOWEVER! FOR ME IT DOES NOT DO THIS!!! It works fine! I can leave or close MTM all I want and it does not lock the screen what so ever. Is it because I'm an admin?
-Ivan R. Perez
-
Thursday, May 10, 2012 5:18 AMModerator
Hi Ivan,
As your issue is not very related to the original post, please re-create a new thread for it so that more community members may come and help you.
Thanks.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
-
Monday, September 17, 2012 8:31 AM
I have found uising option 1 has worked fine for me - I've done exactly what you describe and create a bat file on the desktop. This then allows the agent to run on a vm unlocked.
tscon 1 /dest:console
Regards
Gary
Gary Howlett
-
Monday, September 17, 2012 8:31 AM
I have found uising option 1 has worked fine for me - I've done exactly what you describe and create a bat file on the desktop. This then allows the agent to run on a vm unlocked.
tscon 1 /dest:console
Regards
Gary
Gary Howlett

