Share via


How to: Run Multiple Iterations of a Test Using Different Data Parameters

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.

This procedure describes how to run a manual test using data parameters. Before you run a manual test with data parameters, you must first create a manual test and then add data parameters to it. For more information, see How to: Create a Manual Test Case and How to: Add Parameters to a Manual Test Case To Run Multiple Times with Different Data.

For information about how to map parameters in an action recording, see How to: Map Parameters to Application Fields in an Action Recording for a Test.

Load a Test with Parameters into Test Runner

Selecting test to run in Microsoft Test Manager

To load a test that includes parameters into Test Runner

  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. On the center group switcher, click the down-arrow and then click Testing Center.

  3. On the center group menu bar, click Test.

  4. In the menu under the center group menu bar, click Run Tests if it is not already selected.

  5. In the left pane, under Run Tests, select either the test plan or the test suite listed under the test plan that contains the test with parameters that you want to run.

  6. The right-side pane displays the test cases within the selected test suite.

  7. In the right-side pane, click the test case with parameters that you want to test and then click Run.

    The Test Runner opens.

    Note

    Select Run with options to specify a build to run the test on, or to override the test settings and environment settings for the test plan.

Run Multiple Iterations of Test with Parameters

Running iterations for data parameters

To run multiple iterations of a test with parameters

  1. In Test Runner, you are prompted to Start Test with the option to Create action recording. Leave the Create action recording check box clear and click Start Test.

    Warning

    If you have configured test settings to create an action log for the test being run, selecting the Create action recording option will use the settings that you configured. If you did not configure the actions diagnostic data adapter in your test settings, then the default values are used to create your action recording. For more information, see How to: Record User Interface Actions for Manual Tests Using Test Settings..

    Notice that Test Runner includes iteration information at the top. The number of iterations will be equal to the number of parameter sets that you created when you created the test case. For more information, see How to: Add Parameters to a Manual Test Case To Run Multiple Times with Different Data.

  2. Perform the steps of the test case for the first iteration of the test. To mark the result of a test step, click the drop-down next to the active icon to the right of the test step and then click either Pass or Fail.

    1. When you come to a step that uses a parameter associated with the action, for example the Enter Quantity and Override price steps in the screen shot earlier in this document, you will see the parameter displayed as a link within the test step. You can copy the data that was assigned for the parameter by clicking its link. This copies the data into the system clipboard. You can then copy it into the appropriate input field in the application under test using CTRL+V. After the parameter data has been copied to the application under test, use the drop-down arrow to the right of the step and select either Pass or Fail.

    2. When you come to a step that uses a parameter associated with an expected result, for example, the Click update step in the screen shot earlier in this document, the test step will display the value that is expected for this iteration. Verify that the output field in the application under test is the same as the expected result in the test step, then use the drop-down arrow to the right of the step and select either Pass or Fail.

  3. Click End iteration and move to next.

    The Start test dialog box is displayed.

  4. (Optional)At the top of Test Runner, click the drop-down arrow next to the Iteration count. All the iterations for the test case are listed and the current iteration is highlighted. You can select the next iteration to run from this list.

  5. Repeat steps 1 through 4 until you have completed the iterations you want to test.

  6. In the toolbar at the top of Test Runner, click Save and Close to save your test results to Team Foundation Server and close Test Runner.

See Also

Tasks

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

How to: Map Parameters to Application Fields in an Action Recording for a Test

Concepts

Running Manual Tests Using Test Runner