Dela via


How to: Add Parameters to a Manual Test Case To Run Multiple Times with Different Data

If you want to run a manual test case multiple times with different data, you do not have to create multiple copies of the test case. You can add parameters to the actions or expected results for any test step in your test case. Then you can add multiple sets of values for the parameters that you want to use in your test. Each set of values for the parameters is run as an individual iteration of the test using Test Runner. You can copy the value of each parameter when you run the test and then paste the value into your input field in your application under test.

You can insert a parameter into the action or expected result of a test case as shown in the following illustration. You can also rename or delete parameters in your test case. If a set of data is no longer required, you can delete that data iteration from your test case.

Add Parameters to a Test Case

The results of each iteration are recorded and saved as part of the test result, as shown in the following illustration. The test result is based on the outcome of all the iterations. If all the iterations are marked as passed then the test outcome is passed. If any one of the iterations fails then the test outcome is failed.

View Test Results For a Test With Iterations

Use the following procedure to insert, delete, or rename parameters and add the values for the parameters.

To insert, delete, or rename parameters and add the values for the parameters

  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 contains the manual test case that you want to run multiple times.

    The list of tests in the test suite is displayed.

  4. To open the test case, double-click the test case.

  5. Click where you want to insert your parameter in either Action or Expected Result. Then click Insert parameter.

    The Insert Parameter dialog box is displayed.

  6. Type the name of your parameter and then click Insert parameter.

    The parameter is displayed in the test step preceded by @.

  7. Click Enter.

    The column to add the parameter values for this new parameter is displayed underneath the test steps in Parameter Values.

  8. Repeat steps 5 to 7 to add all the parameters that you require for this test case.

  9. To add the values for the parameters, click one of the columns for the parameters.

    A new row is displayed to use to add a set of parameter values.

  10. Type the values for all your parameters.

  11. (Optional) To enter another iteration for your test, click Enter.

    Another row is displayed to add another set of parameter values.

  12. (Optional) To delete a parameter from your test case, click the parameter in one of the rows in Parameter Values and then click Delete parameter.

    The Delete parameter dialog box is displayed. You can replace the parameter with a fixed value or just remove it from your steps.

  13. (Optional) To rename a parameter in your test case, click the parameter in one of the rows in Parameter Values and then click Rename parameter.

    The Rename parameter dialog box is displayed. You can then change the name of your parameter throughout your test case.

  14. (Optional) To delete an iteration, right-click the row of data in Parameter Values for the iteration you want to remove and then click Delete iteration.

  15. To save the parameters and values that you have added to the test case, click Save in the toolbar.

  16. To run the iterations for this test using the parameter values that you have entered, click Test to view the Test activity and click Run Tests. Select the test case with parameters and click Run.

    Test Runner is started and your test and the iterations are displayed. You can paste the parameter values for each iteration into your application under test as you run each test step.

    Note

    For more information about how to run the test, see How to: Run Multiple Iterations of a Test Using Different Data Parameters. To view the test results, see How to: View Test Results Using Microsoft Test Manager.

See Also

Tasks

How to: Share Common Test Case Steps Using Shared Steps

How to: Run Manual Tests

How to: Run Multiple Manual Tests in a Test Suite

How to: View Test Results Using Microsoft Test Manager

Concepts

Creating Manual Test Cases