Bagikan melalui


How to: Add a Test Case to a Test Suite

You can add existing or new test cases to your test suite at any time using Microsoft Test Manager. When you add a test case to your test suite, a pairing of the test case with each default configuration for the test suite is added to the test plan. When you run the tests from the test plan, these pairings will be shown and each can be run individually and test results will be saved for it.

To include new test cases for a test suite that was created by using a query, you may want to change the query. For more information about these types of suites, see How to: Create and Manage Query-Based Test Suites.

Add Test Cases to a Test Suite

Note

If the test suite was created by adding a requirement to the test plan, any existing test cases or new test cases that you add to the test suite will automatically be linked to the requirement.

Use the following procedure to add a test case to a test suite that is not a query-based test suite.

To add a test case to a test suite

  1. Open Microsoft Test Manager.

    Note

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

  2. From the Testing Center, click Plan and then click Contents.

    The Contents pane is displayed.

  3. Select the test suite in the test suite hierarchy pane that you want to add test cases to, and then click Add.

    The Add test cases to suite dialog box is displayed. All available test cases are shown in the list of tests.

    Note

    Tests that have already been added to the test suite are not shown in the list of tests.

  4. (Optional) If there are several test cases listed, you can narrow your test case search by changing the query for test cases as shown in the following steps.

    1. To add a new clause to your query, select Click here to add a clause.

    2. Click each column in the query clause to fill in the clause. If a column has a list of accepted values, a drop-down arrow appears when the column is selected. Click the drop-down arrow to select a value from the list. The following columns are available:

      Query Column

      How to complete

      And/Or

      Select And if this clause and the previous clause must be true to match a result. Select Or if either this clause or the previous clause must be true to match a result.

      Field

      The list for this field contains all the searchable work item fields used in the current Team Foundation Server. Use as many clauses and fields as you want to get useful results. Press ALT+DOWN ARROW or type the field name that you want to select.

      Operator

      Examples of operator choices are = (equal), <> (not equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), In, Was Ever, Was Never, and Contains.

      Value

      Specifies the value that you are looking for in the specified field. If there is a list of values to select from, click the drop-down arrow to select the one that you want. Team Foundation work item tracking includes some query variables to dynamically add values to your query. For more information, see Query Variables.

    3. Repeat the previous two steps to add all the values for which you want to search.

    4. To see the results of your query, click Run to run the query.

  5. Select the tests that you want to add, and then click Add test cases.

    The test cases that you selected are now displayed in the test suite details pane.

    Note

    All the existing test cases that you add, or new test cases that you create, are paired with each default configuration to define what tests must be run on which configurations for the test plan. To see these pairings, select the test suite and click Configurations.

  6. To create a test case and add it to this test suite, click New.

    The New Test Case dialog box is displayed.

  7. Enter the details for your new test case including the actions and expected results for each test step, and then click Save and Close.

    The new test case is now displayed in the test suite details pane.

    Note

    For more information about how to create new test cases, see How to: Create a Manual Test Case.

  8. Repeat the previous two steps to add more test cases.

    The changes that you have made to the test suite in the test plan are automatically saved.

    Note

    To add a copy of an existing test case to the test suite, right-click a test case in the test suite details pane and point to Create copy and add to suite. The new test case dialog box is displayed so that you can edit the test case as necessary.

See Also

Tasks

How to: Create and Manage Query-Based Test Suites

Concepts

Defining Your Testing Effort Using Test Plans

Other Resources

How to: Create and Manage Requirement-Based Test Suites