Distributed Coded UI Tests
Coded UI Tests can be run in a distributed fashion. It leverages the existing Load Test architecture. Read the Load Test Team blog for more information.
Since Coded UI Tests always interact with the UI, the following change has to be made for the Agent on which they has to be run.
UI Testing on an Agent
If you want to run a test that has a UI or interacts with the desktop or user settings, you will need to use QTAgentServiceUI on the agent instead of QTAgentService.exe. QTAgentServiceUI works exactly like QTAgentService, except that it runs as a user process rather than a service. We recommend you configure your agent to automatically logon as a test user, and then in the startup for that user run QTAgentServiceUI.bat. This bat file simply runs QTAgentServiceUI over and over, so that if the agent service dies it will be automatically restarted.
In the Coded UI Test Project, double click on the testsettings file.
In the Execution Criteria, choose Execute Tests remotely.
Select the name of the controller to use for remote test execution.
If there are multiple agents associated with the controller, we can filter the agents on which the test has to be run based on properties. In the screenshot above, i am using a property named CodedUITest to differentiate agents. I will set this property to true for the agent on which I want to run the Coded UI Test. (Remember this has to be run as the batch file and not as the service).
In the screenshot above, see how i have set the property for my agent.