Coded UI Test in a Team Build


In this post, i will describe the steps required to add a Coded UI Test in a Build Definition.

Pre-requisites:-  An existing Coded UI Test Project, A Connection to Team Foundation Server

0. On the Build Server, we need to run the Team Build Service Host as an interactive process, since it will Coded UI Tests which interact with the desktop.

0.a. Open Team Foundation Server Administration Console, ad click on the Team Foundation Build Configuration.

image

0.b. Click on Properties link for the Build Service Host.

Click “stop to make changes” and choose to Run the Build Service as “Interactive Process”.

            image

0.c. Click Start.

This will start the Build Service Host as an interactive process.

 

1. In the Solution Explorer, right click on the Coded UI Test Solution and choose Add Solution to Source Control.

image

2. Choose the folder in which you want to add this solution.

image

3. In the Pending Changes window, add a Comment and check in the code.

image

 

4. Open Team Explorer and Create a New Build Definition

image

 

5. Specify a name for the Build.

image

6.  Leave the Trigger & Workspace tabs unchanged. [The default values are sufficient]

7. In the Build defaults tab, specify the Build Controller & a drop folder for the build.

image

8. In the Process tab, specify Projects to Build (select the project that you checked in in step 3).

By default all tests in assembles matching *test*.dll will be run.

image

9. Save the Build Definition and Queue a new build.

image

10. In the Build Explorer, you can see the status of the Queued Builds. Double click on a Build to see its log.

image

In the detailed log, you can see the Coded UI Test getting compiled and then run.

image 

image


Comments (3)

  1. Cameron Skinner on 10-4 Video on Beta 1 Installation and Visual Studio 2010 and DSL Toolkit SDK Beta

  2. George says:

    With the above steps, the coded UI test failed with the error:

    Error calling Initialization method for test class FunctionalTest.BTS_BN_LeftNav_Test: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {6DA215C2-D80D-42F2-A514-B44A16DCBAAA} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    And the Error Stack Trace:

    Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.InitPlayback()

    Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()

    My one Unit test (not coded UI test) is fine in the queued build.