|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
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
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.
(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.
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
Select one or more tests and click Run Tests.
(Optional) Change the code you tested or the code of the tests you ran.
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.