Share via


How to: Search for Test Cases from Microsoft Test Manager

You might want to search for all the test cases in your team project using Microsoft Test Manager, or you might want to search for only specific test cases. You can customize a query to search for only the test cases you want to see. For example, you can create a query to search for just the priority 1 test cases you own. You can save this query to use later.

There are two categories of queries.

  • Team Queries   These queries are available to everyone in your team project. Team Queries can only be created and modified by people who have been granted permission to create them by your team project administrator.

  • My Queries   These queries are available only to you.

Requirements

  • Visual Studio Ultimate, Visual Studio Premium, Visual Studio Test Professional

Use the following procedures to view test cases and create queries to search for test cases:

  • View all test cases in your team project

  • Customize the test case manager view

  • Use pre-existing team queries to view test cases in your team project

  • Create a customized query to search for specific test cases

For more information about how to manage queries and folders, see How to: Create and Manage Queries for Searching Using Microsoft Test Manager.

Note

You can also search for test cases using Visual Studio. For more information, see Find Bugs, Tasks, and Other Work Items.

View All Test Cases

To view all test cases

  1. Open Microsoft Test Manager.

    Note

    To display the Microsoft Test Manager window, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. To open the Test Case Manager, choose the down-arrow on the center group switcher and choose Organize.

  3. In the center group menu bar, choose Test Case Manager.

    The Test Case Manager is displayed and all the test cases are shown in the list.

    Note

    All active and closed test cases are displayed in this view. If you do not want to see the closed test cases, you can either create a customized view or create a query to view specific test cases. For more information, see Customize the test case manager view or Create a Query to View Specific Test Cases.

  4. (Optional) To filter the test cases that you see in this list, choose the column header that you want to use to filter. For example, choose Owner. Then choose the drop-down arrow that is now displayed in the column header and select the values that you want to use to filter the test cases.

    The filter is immediately applied to the list and only the test cases that meet the criteria selected are shown.

    Note

    This functionality to filter lists by choosing a column header is available throughout Microsoft Test Manager.

Customize the test case manager view

To customize the test case manager view

  1. Open Microsoft Test Manager.

    Note

    To display the Microsoft Test Manager window, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. To open the Test Case Manager, choose the down-arrow on the center group switcher and choose Organize.

  3. In the center group menu bar, choose Test Case Manager.

    The Test Case Manager is displayed and all the test cases are shown in the list.

    Note

    All active and closed test cases are displayed in this view.

  4. To change the query that is used by default to show all the test cases, choose Unfiltered and point to Edit filter.

    The Edit filter view is displayed.

  5. To add a new clause to the default query for the test case manager to only show the test cases that are not closed, choose Choose here to add a clause and select the following values for each field:

    And/Or

    Field

    Operator

    Value

    And

    State

    <>

    Closed

  6. To add more clauses to your query to customize the test cases returned, choose Choose here to add a clause.

    You can now add the clauses that you require for this query. For more information about how to specify the criteria for your query, see Specify Query Filter Criteria.

  7. After you add all the values that you want, choose Save query to save this query as the default query for the test case manager.

    Note

    To clear this query and reset to the original query, choose Filtered and point to Reset filter.

Use Pre-Existing Team Queries to View Test Cases

When your team project is created by your team project administrator, there are pre-existing test case queries that they can add. For example, My Test Cases is a pre-existing query that will return all your test cases.

To view test cases with pre-existing team queries

  1. Open Microsoft Test Manager.

    Note

    To display the Microsoft Test Manager window, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. To open the Queries activity, choose the down-arrow on the center group switcher and then choose Testing Center.

  3. In the center group menu bar, choose Track and then choose Queries.

    The Queries activity is displayed.

  4. To view the pre-existing team queries, open the Team Queries folder.

  5. To run the pre-existing query, double-click the query that you want to run.

Create a Customized Query to Search for Specific Test Cases

To create a customized query to search for specific test cases

  1. Open Microsoft Test Manager.

    Note

    To display the Microsoft Test Manager window, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. To open the Queries view, choose the down-arrow on the center group switcher and then choose Testing Center.

  3. In the center group menu bar, choose Track and then choose Queries.

    The Queries view is displayed.

  4. To select the folder where you want to create the query, choose the folder in the queries folder hierarchy.

    Note

    You can create a subfolder and store your queries there. For more information, see "Create a Subfolder to Store a Query" in How to: Create and Manage Queries for Searching Using Microsoft Test Manager.

  5. To create a query, choose the drop-down arrow next to Query, and point to the type of query that you want to create.

  6. To enter a name for this query, type the name.

    Important

    The first clause shown for the query makes sure that only items from your team project are returned in the results of the query. Do not change this clause.

  7. You can now add the clauses that you require for this query. For more information about how to specify the criteria for your query, see Specify Query Filter Criteria.

    To add a new clause to your query to select only test cases, choose Choose here to add a clause and select the following values for each field:

    And/Or

    Field

    Operator

    Value

    And

    Work Item Type

    =

    Test Case

    To add more clauses to your query to customize the test cases returned, choose Choose here to add a clause.

  8. To see the results of your query, choose Run to run the query.

  9. (Optional) To change the columns or the sort order for the query results, choose Column options.

    1. In the Column Options dialog box, select the columns to add from Available columns, choose the arrow to add these columns to the Selected columns.

    2. Choose Sorting and select the columns that you want to sort by.

    3. Choose OK.

  10. (Optional) To group the query results by a column, drag a column header in the query results table to the title bar of the query results.

  11. When the query you created returns the test cases that you want to view, choose Save on the toolbar.

    The query is now saved.

See Also

Tasks

How to: Create and Manage Queries for Searching Using Microsoft Test Manager

Concepts

Creating and Managing Tests