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.
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.
Use the following procedure to insert, delete, or rename parameters and add the values for the parameters.
- Visual Studio Ultimate, Visual Studio Premium, Visual Studio Test Professional
To insert, delete, or rename parameters and add the values for the parameters
Open Microsoft Test Manager.
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.
From the Testing Center, choose Plan and then choose Contents.
The Contents pane is displayed.
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.
To open the test case, double-click the test case.
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.
Type the name of your parameter and then choose Insert parameter.
The parameter is displayed in the test step preceded by @.
The column to add the parameter values for this new parameter is displayed underneath the test steps in Parameter Values.
Repeat steps 5 to 7 to add all the parameters that you require for this test case.
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.
Type the values for all your parameters.
(Optional) To enter another iteration for your test, choose Enter.
Another row is displayed to add another set of parameter values.
(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.
(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.
(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.
To save the parameters and values that you have added to the test case, choose Save in the toolbar.
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.
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 Manual Test Case Results Using Microsoft Test Manager.