5

I have a Test Case in Microsoft Test Manager 2010 that is used in a Test Plan.

How can I find this Test Case in the Test Plan? Is there at least a column in the Organize view that shows the paths of the Test Plans where the Test Case is used?

Elena
  • 1,928
  • 1
  • 15
  • 23
Roland Bär
  • 1,720
  • 3
  • 22
  • 33

1 Answers1

2

Unfortunately, MTM UI does not provide any possibility to search for Test Cases.

Edit: (see comment)
Unfortunately, MTM UI does not provide any possibility to search for Test Cases that belong to a particular Test Plan or Test Suite.

May be a solution for you:
You can check to which Test Suites a particular Test Case belongs to using TFS-API.
Here is a code snipped that works on TFS 2013:

// Current user credentials will be used to access to TFS
TfsTeamProjectCollection tfsCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(<TFS Url>));
tfsCollection.EnsureAuthenticated();

ITestManagementService testManagementService = tfsCollection.GetService<ITestManagementService>();
ITestManagementTeamProject  teamProject = testManagementService.GetTeamProject(<team project name>);

// Get all Test Suites your Test Case belongs to
// (Across all Test Plans in the Team Project)
ITestSuiteCollection testSuites = teamProject.TestSuites.ReferencingTestCase(testCaseId);


Have a look at the ITestManagementTeamProject Interface, you can do a lot with it.
(Hint: currently this interface is absolutely not documented for VS 2013 so switch the page to VS 2012 and you will usually find a little more documentation).

For your task on building a whole path to the particular Test Suite check ITestSuiteHelper Interface and ITestSuiteBase Interface. They provide you with data you need to follow the Test Suites' tree of your project.

Elena
  • 1,928
  • 1
  • 15
  • 23
  • This is not exactly true. You have in the 'Organize'->'Test Case Manager' the possibility to filter the Test Cases, but you don't get any information, where the Test Cases are located in the Test Plans. – Roland Bär May 08 '14 at 09:47
  • That what I actually meant since that was your question ;). I've just improved the answer. – Elena May 08 '14 at 10:20
  • Thanks, your code is quite helpful. But my problem is, that I already knew that the TestCase is in this TestPlan, but as it is a big TestPlan with a lot of branches (and subbranches...) it is quite hard to find the right branch. From the linked WIQL document I don't see how this tree is built. Can you give me a hint (or even better entend the code)? – Roland Bär May 08 '14 at 15:11
  • How do you represent branches in your test plan? Do you have a Test Suite for each branch/subbranch? If so would it be enough to know the names of the Test Suites the test case belongs to? Or do you want to have the whole "path" in the tree? – Elena May 08 '14 at 15:49
  • Yes, exactly the last one. The Test Plan contains a big tree, so opening every branch of the tree is really anoying... So I look for a way to get the path from the root node of the tree through all branches, so I can then follow this path in the MTM. – Roland Bär May 08 '14 at 17:39
  • I've just extended my answer. It should contain all information you need. – Elena May 09 '14 at 06:30