To execute TestArchitect test cases from MTM, an
association between TestArchitect tests and Team Foundation
Server tests must be created in the related Visual Studio project.
Ensure that you have already taken the following step(s):
Created TA-TFS integration
Running TA tests from MTM requires two types of associations:
mappings of TA and TFS test cases in the two respective systems, discussed
- a process of association in the related Visual Studio project. This process
automatically generates C# code snippets in Microsoft Visual Studio to link the
TA and TFS test cases.
Start Visual Studio.
Right-click a project, and then select Associate.
Alternatively, click the Associate
button on the Visual Studio toolbar.
Note: If the Associate button is not visible
on the Visual Studio toolbar, enable the button by right-clicking on the
toolbar and selecting TestArchitect from the context
In the Connect to Team Foundation Server dialog box,
select the server to connect to from the Team Foundation
Server drop-down box, and then choose the correct team project
values for Team Project Collections and Team
Projects. Click Connect to establish an
association between TFS and TestArchitect.
In the Select Test Plan dialog box, choose a test plan,
then click Select plan to proceed.
In the Associate Tests dialog box, select the test suites
and test cases to associate with the tests. Tests which have been associated
previously are selected automatically. After you finish selecting the desired
tests, click Associate.
- TFS test cases that have not been associated are indicated in GREEN.
Whereas, TFS test cases that have been associated are indicated in
BLUE. Note that, if you select associated TFS test cases, they will
- Filtering TFS test cases:
- In the Associate Tests dialog box, you
can select the Filter button to
narrow down the list of test cases displayed based on the
- In the Advanced filter dialog box, by
defining one or more clauses, you can filter from work items
to return the set of work items that interest you. For more
information about query fields, operators, and macros, see
- To temporarily disable the specified filtering conditions,
in the Associate Tests dialog box,
clear the check box as follows.
- To remove totally the specified filtering conditions, in the
Associate Tests dialog box, click
X as follows.
- If the test association fails due to some reasons, you will see the
following error dialog box. Click View Log File
to troubleshoot, if needed.
- If the test association succeeds, a confirmation dialog box
Click OK to exit the confirmation dialog box.
- Under the TestArchitect_Generated folder, test
methods are generated in the project as follows:
- In MTM, information on the association is added into test cases as
Check in the solution to save the associated data by doing the following:
In Solution Explorer, right-click your solution
and then click Check In.
In the Check In dialog box, type an appropriate
comment, and then click Check In.
Visual Studio will check in the solution files to the Team
Foundation source control.
For TFS 2017, you are required to explicitly check in the
Microsoft Visual Studio automatically generates C# code snippets which associate the
test cases with the TFS test cases. You
normally do not need to edit the generated snippets. However, you should verify that the
test case IDs for each test method match the associated IDs.
In the above example, four C# test methods have been generated (one method for each
test case) for the four TestArchitect
test cases (TC01,
TC02, TC03, and TC04). Each method consists of a call to RunTestCase
which starts the execution of the TestArchitect
whose source field maps to the TFS test cases with identifiers 703
, and 706
Important: This task is one that
must often be repeated, especially when you have modified mapped TFS test cases.
(For example, you remove or add test cases, or change the order of a test case
run.) When you do so, the association between TFS test cases and Visual Studio
test methods/TestArchitect test cases is
compromised. Hence, it is necessary that you perform the following steps
TestArchitect test cases with TFS test
- Check in your project.
- Queue the build.