Partager via


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.

 

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

 

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.

image

d. Click on … button next to Automated Test Name & Choose the CodedUITestMethod and save the test Case.

image

 

 

Step 2: Setup the environment for running a Coded UI Test.

a. In Microsoft Test & Lab Manager, Navigate to the Lab tab and create a new Physical Environment.

image

Add an available machine to the environment and give it the role of Desktop Client.

image

 

Finish the activity.

 

c. Navigate to the Test Settings tab and create a new Test Settings.

Choose to Run Automated tests.

image

Select the Desktop Client role. The environment that we created earlier matches this role.

image

Finish the activity.

 

d. Navigate to the Testing Center and choose the Properties of the Plan.

Set the Test Settings & Test Environment for Automated Runs.

Set the Filter for Builds and Build in Use also.

image

 

Save and close the Test Plan.

 

e.  Click on Plan activity.

Add the Test Case (seen in Step 1) to the new Test Plan.

image

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.

 

image

The status of the Test Run is shown in MTLM.

image

 

The Coded UI Test will be run on the specified environment.

Comments

  • Anonymous
    May 25, 2009
    PingBack from http://microsoft-sharepoint.simplynetdev.com/coded-ui-test-from-microsoft-test-lab-manager/

  • Anonymous
    May 11, 2010
    Hi Mathew, I've created an Coded UI Test and I want to run it with Test Manager. And I've read the configurations that must be done. Wow!!! Built agents, test agents, Hyper-V Host, SCVMM.... If I can run the test from visual studio, if I want to run them from Test Manager why do I need a virtual machine? I've associated my test method from my project with an test case in Test Manager, I've installed build agent, test agend, Hyper-v Host, but when I've read about SCVMM, I didn't knowed what to do... And my main question is: Do I really need all of that stuff?

  • Anonymous
    May 11, 2010
    You don't have to setup Hyper-V host and SCVMM if we are not using Lab Management. The minimal setup would be as I have described above. In this blog, i use a Physical environment which does not require Hyper-V and SCVMM. Also note that this is a first time setup cost. You will be able to reuse this setup for your entire testing effort afterwards.

  • Anonymous
    May 13, 2010
    Hi Mathew, do you know why I can not create physical environments? Th e option "New physical environment" is disabled (read only).

  • Anonymous
    May 13, 2010
    You need to install a Test Controller and register it with Team Foundation Server.

  • Anonymous
    May 13, 2010
    When I reach at Step 2, d, I can not select any built in use. How can I create one? I have already two build definitions.

  • Anonymous
    May 14, 2010
    In Team Explorer, you will have to create a Build Definition for your project and then Queue a build.

  • Anonymous
    May 26, 2010
    is it possible to have two built services? I ask that because we have here two collections and when I need to create a build, I need to set the service for my collection (as I said, we have more than one project). Thanks