Bagikan melalui


How to: Export Test Results

Every time that you run one or more tests, the results of the test run are automatically saved to disk in a file with the extension .trx. This makes it possible to retrieve test data for any tests you have run in the past. For information about retrieving test data, see How to: Import Test Results.

Note

To save disk space, you can limit the number of test runs that Visual Studio stores. For more information, see How to: Limit the Number of Stored Test Runs.

You can also explicitly store the results of a test run by creating another .trx file with a name that you have chosen; this is known as exporting. You can also specify the folder in which to store it. Specifying a name and a folder makes it easier to find and reuse a test run that is of particular value to you.

Exporting test results does not affect whether or how Visual Studio automatically saves test results. When you export a test run as described here, you create an additional copy of the test results in a file that you designate.

Note

Exporting test results is different from publishing test results. For more information, see How to: Publish Test Results and Moving Test Data into the Data Warehouse.

To export test results for an entire test run

  1. Run one or more tests.

  2. On the Test menu, point to Windows and then click Test Results.

    The Test Results window is displayed.

  3. On the Test Results window toolbar, click Export Test Run Results.

    - or -

  4. Click the down arrow on the Export Test Run Results button and then click Export Test Run Results.

    The Export Run <test run name> dialog box is displayed.

  5. (Optional) In the Save In box, select a different folder.

  6. (Optional) Type a file name in the File name box and then click Save.

    The results for all the tests of the current test run are saved in a file with the .trx extension with the file name that you specified.

To export test results for selected tests only

  1. Run one or more tests.

  2. On the Test menu, point to Windows and then click Test Results.

    The Test Results window is displayed.

  3. Highlight one or more rows in the Test Results window.

  4. Click the down arrow on the Export Test Run Results button on the Test Results window toolbar and then click Export Selected Test Results.

    The Export Selected Results dialog box is displayed.

  5. (Optional) In the Save In box, select a different folder.

  6. (Optional) Type a file name in the File name box and then click Save.

    The test results for the selected tests of the current test run are saved in a file with the .trx extension with the file name that you specified.

See Also

Tasks

How to: Import Test Results

How to: Publish Test Results

How to: Delete Test Results

Concepts

Moving Test Data into the Data Warehouse