Coded UI Test from Microsoft Test & Lab Manager
After you have created a Coded UI Test and added it to a Team Build, you can run the test from a Microsoft Test & Lab Manager (MTLM). In this post, i will describe the steps to enable this.
NOTE: When run from MTLM, coded UI tests must be run using an environment like any other automated tests. There is no option to run coded UI test locally unless your test agent and controller are installed locally.
Step 0: Run the Test agent from the command line.
a. On the Visual Studio Team Test Agent box, Open the Services Management Console.
b. Stop the Visual Studio Team Test Agent.
c. Run the Visual Studio Team Test Agent from the command line.
Step 1: Associate the Coded UI Test to the Test Case.
a. In Visual Studio, Open the Coded UI Test Project.
b. Open the Test Case from Team Explorer.
c. Navigate to the Associated Automation tab.
d. Click on … button next to Automated Test Name & Choose the
e. Choose the CodedUITestMethod and save the test Case.
Step 2: Setup the environment for running a Coded UI Test.
a. In Microsoft Test & Lab Manager, Navigate to the Lab Center and choose Controller tab. Add a new Controller.
Save & Close the Test Agent Controllers activity.
b. Navigate to the Environment tab and create a new Physical Environment.
Add the Desktop Client Role.
Assign the available machine to this role.
Finish the activity.
c. Navigate to the Test Settings tab and create a new Test Settings.
Choose to Run tests using an environment.
Associate the environment created in the previous step.
Finish the activity.
d. Navigate to the Organize Center & choose Test Plans tab.
Create a new Test Plan and set the Automated Test Settings to the Test Settings created in the previous step.
Also choose the Build Candidates and assign a Build to the plan.
NOTE: the Build Quality can be set for a build by opening it in Visual Studio Team Explorer.
Save and close the Test Plan.
e. Navigate to the Testing Center and click on Plan activity.
Add the Test Case (seen in Step 1) to the new Test Plan.
Step 3: Run the Coded UI Test from Microsoft Test & Lab Manager
Navigate to the Testing Center & choose Test tab.
Right click on the Test Case and choose Run.
The status of the Test Run is shown in MTLM.
The Coded UI Test will be run on the specified environment.