The Test Agent can run in either Service or Process mode. For the 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 the test controller doesn't even get started.
There are 2 ways to keep an active desktop that I know of:
(recommended) Run AutoLogOn.exe from Sysinternals suite (can be found at http://live.sysinternals.com/). It will automatically log in with a specified user then the machine starts, and keep the desktop active.
Keep a remote desktop in a non minimized window active. There are few applications that you can find that can keep multiple remote desktops open, and keeping it connected should do the trick.
To run Coded UI test cases on remote systems, you can follow the steps below:
Set up the remote system for test execution: Ensure that the remote system is set up with the necessary software and configurations required for Coded UI test execution.
Build the test project: Build the Coded UI test project on your local machine to generate the necessary test assemblies and executables.
Copy the test files to the remote system: Copy the test assemblies and executables to the remote system. You can use tools like Robocopy, FTP, or network shares to transfer the files.
Configure the test controller and test agents: Set up a test controller and test agents on the remote system. The test controller coordinates the test execution, and the test agents execute the tests on the remote system.
Configure the test settings: Configure the test settings file to specify the remote system as the test execution environment.
Run the tests: Use Visual Studio or the command-line test runner to run the tests on the remote system.
Note: You may need to configure security settings, network access, and permissions to ensure that the remote system can access the necessary resources and execute the tests successfully.
StickyMinds is a TechWell community.
Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.