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 Test Agent has to be run as interactive process.

See How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop


In the Coded UI Test Project, double click on the testsettings file.

image image


In the Roles section, choose Remote Execution.

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 have added a role named ‘Client” and  added an attribute “CodedUITest” and set its value to “True”. You can click on "Preview matching test agents” to detect how many agents match the selected attribute.

I will set this property to true for the agent on which I want to run the Coded UI Test. Remember this agent has to be run as an interactive process. (This dialog is invoked from Test –>  “Manage Test Controller” menu)

image image


In the screenshot above, see how i have set the attribute “CodedUITest” to “True” for my agent.

Comments (4)

  1. Thank you for submitting this cool story – Trackback from DotNetShoutout

  2. Mathew explains how to leverages the existing Load Test architecture in order to run Coded UI Tests in

  3. TribeRibbet says:

    Seems to work wth some caveats:

    1. Visual Studio must be "Run As Adminsitrator", otherwise, I get an error that says I do not have permissions to do this.

    2. Doesn't seem to work if you have multiple attributes for one role.  For instance, Client has "CodedUITest" attribute, and also "AnotherCodedUITest" attribute.  On the Agent Properties window, it is required that both CodedUITest and AnotherCodedUITest are there; otherwise, the "Preview matching test agents" does not recognize the agent.  But even after both are added, when attempting to execute a test, there is an error "There is no agent available for the role that must run the tests".

    It does seem that multiple attributes are supported.  We understand if the Agents must have matching attributes.  But something seems wrong about not being able to run tests if more than one attribute is applied to the Role.