How do I run Coded UI test cases on remote systems?

Vivek Kulkarni's picture

I have Coded UI framework. Need to run the test cases on remote systems. Want to know how to do?

Using Visual Studio 2019 for development.


2 Answers

Steve Skok's picture

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:

  1. (recommended) Run AutoLogOn.exe from Sysinternals suite (can be found at It will automatically log in with a specified user then 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 desktops open, and keeping it connected should do the trick.
Priti Gaikwad's picture

To run Coded UI test cases on remote systems, you can follow the steps below:




  1. 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.
  2. Build the test project: Build the Coded UI test project on your local machine to generate the necessary test assemblies and executables.
  3. 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.
  4. 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.
  5. Configure the test settings: Configure the test settings file to specify the remote system as the test execution environment.
  6. 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.