How to: Rerun a Test

After you run a single test or several tests, you can repeat the test run. Between test runs, you can make changes to the code you are testing, to the code of the test methods, or to the active test run configuration.

To rerun a test run using the Test Results window

  1. After you run one or more tests, the Test Results window displays a row for each test that was run. Each test that did not produce a Passed result is automatically selected; that is, the check box in the test's row is selected. You can select additional rows in the Test Results window, or clear tests that you do not want to run again.

    When at least one row is selected, the status bar for the Test Results window displays the word Rerun original tests.

  2. (Optional) Change the code you tested, the code of the tests you ran, or settings in the active test run configuration. For more information about how to change test run configuration settings, see How to: Specify a Test Run Configuration.

  3. Click Rerun original tests.

    - or -

    On the Test Results window toolbar, click Run with. This displays the Browse for Test Run Configuration dialog box, which you can use to select a different run configuration while rerunning the selected tests.

    Any projects with changed code are rebuilt. The tests represented by the selected rows are run again.

To rerun a test run using Test View window or Test Manager window

  1. Select one or more tests and click Run Tests.

  2. (Optional) Change the code you tested or the code of the tests you ran.

  3. Because the tests you ran remain selected, you can click Run Tests to run the same tests again. Before the tests are run, any projects with changed code are rebuilt.

See Also

Tasks

How to: Run Selected Tests