I\'m attempting to automate Coded UI tests.
My test controller launches the tests on a remote test server, which I normally access via a Remote Desktop connection.
From MSDN:
The computer that is running an agent on which you want to run coded UI tests cannot be locked or have an active screen saver.
If you are running your CodedUi Tests
through Visual Studio (means that tests are executed under your account), I believe that you must be connected via remote desktop to the remote test server.
However, you can use Microsoft Test Manager
to run your tests:
--Preferred Solution 1: Have a Hyper-V Client and simply run coded UI tests using a schedule task. No issues at all.
--preferred Solution 2: You need to have 2 VM. First remote desktop to VM 1, then from VM 1 remote desktop to VM 2 where Coded UI will be running. Once Coded UI started in VM2, simply disconnect VM 1. This will keep the session opened and will never have any issues
-less preferred Solution 3: Restart VM using command line. Make sue auto-log in is enabled on your VM. Have a scheduled task to run coded UI.
I used this method and found some of my tests breaks.
--least preferred Solution 4: use tscon.exe %sessionname% /dest:console I used this method but cannot guarantee that your test will run with out any issues