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.

Requirements

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

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, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. From the Testing Center, choose Plan and then choose 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. Choose where you want to insert your parameter in either Action or Expected Result. Then choose Insert parameter.

    The Insert Parameter dialog box is displayed.

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

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

  7. Choose 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, choose 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, choose Enter.

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

  12. (Optional) To delete a parameter from your test case, choose the parameter in one of the rows in Parameter Values and then choose 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, choose the parameter in one of the rows in Parameter Values and then choose 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 choose Delete iteration.

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

  16. To run the iterations for this test using the parameter values that you have entered, choose Test to view the Test activity and choose Run Tests. Select the test case with parameters and choose 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.

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 Manual Test Case Results Using Microsoft Test Manager

Concepts

Creating Manual Test Cases