Dela via


Running Tests

If you have Visual Studio Test Professional 2010 or Visual Studio 2010 Ultimate, you can run manual tests and automated tests from a test plan by using Microsoft Test Manager. When you run any of these tests from your test plan, you can save your test results into the team project for your Team Foundation Server. You can now view the progress of both your automated and manual tests from your test plan.

If you have Visual Studio 2010 Ultimate ,Visual Studio 2010 Premium, or Visual Studio Professional you can run automated tests from Microsoft Visual Studio 2010 or from the command line. You can also run tests by using Team Foundation Build. Test results are created every time that you run a group of tests.

To run manual tests, you must use Microsoft Test Manager to run your tests from a test plan, as shown in the following illustration. Then you can view your test results from your test plan.

Run Manual Tests

After you have created any of the following types of automated tests by using Microsoft Visual Studio 2010, you can use Microsoft Test Manager or Microsoft Visual Studio 2010 to run the tests:

  • Unit tests.

  • Coded UI tests.

  • Database unit tests.

  • Load tests.

  • Generic tests.

For example, if you want to run your automated tests and see the results immediately, you can just run your tests from Microsoft Visual Studio 2010 and view the test results, as shown in the following illustration.

Run Automated Tests From Visual Studio

Note

These test results will not be part of a test plan, even if you publish these test results to Team Foundation Server.

If you want to run your automated tests and have the results added to a test plan, you can associate your automated tests with test cases using Microsoft Visual Studio 2010, and then run them using Microsoft Test Manager, as shown in the following illustration.

Run Automated Tests Using Microsoft Test Manager

Database Unit Tests

To run database unit tests, additional runtime assemblies are required. These assemblies are available only in the following SKUs:

Visual Studio 2010 Ultimate

Visual Studio 2010 Premium

Visual Studio Professional

Based on the following ways that you can run the database unit tests, you may have to install one of these SKUs on additional machines:

  • If you run database unit tests locally by using Visual Studio, you must have one of these SKUs installed locally.

  • If you run database unit tests by using a test controller and test agents from Visual Studio, you must install one of these SKUs on any test agent computer that can be used to run these tests.

  • If you associate your database unit tests with a test case and run these tests from Microsoft Test Manager, you must install one of these SKUs on any test agent in your environment that is included in the role to run tests. You must also install one of these SKUs on the test controller for this environment.

Tasks

Use the following topics to help you run your tests.

Tasks

Associated topics

Setting up how to run your tests: By using test settings, you can define where to run your tests, what data to collect, or how to affect the test machine when you run your tests. If you have a multitier application, you can select a set of roles for this. You can then use a physical or virtual environment that contains these roles to run your tests from your test plan. Or you can use a test controller and test agents when you run your tests by using Microsoft Visual Studio 2010.

Running manual tests from a test plan: You can run manual tests from your test plan by using Test Runner to record if each step passes or fails. The test outcome and any data that is collected when you run the test can be saved. You can also submit bugs when you run your manual tests.

Speeding up manual testing: You can record the UI actions that you take when you run a manual test. When you run the test again, you can play back the action recording that you created to fast-forward to a specific location in your test by automatically performing these actions.

Running automated tests: You can run tests directly from Microsoft Visual Studio 2010, from Microsoft Test Manager, from Team Foundation Build, or from the command line. You can use mstest.exe to run your automated tests from the command line, or you can use tcm.exe to import your test methods into test cases. You can then run the test cases for specific configurations from the command line and save the results for the appropriate test plan.

You can also submit bugs for any issues that you find.

Finding tests that have to be run: You can find recommended tests to run based on code changes to the application under test. You can also check which builds have specific bugs that have been fixed or new features or requirements, and then determine which tests to run.

Analyzing test results: You can analyze the test results for each test run of your automated tests. You can also review the code coverage results to verify that your tests are testing as much of your application as possible.

Customizing how your tests are run: You can create your own diagnostic data adapters to collect specific data or affect the test machine when you run your tests.

Running Load and Web Performance Tests

You can also run test to isolate stress and load issues by using load and Web performance tests.

Guidance for Build, Deploy and Test Workflows

If you want to build your application, deploy the application, and run tests as part of a workflow, you need to determine the software components that you require and the topology that you need to use.

See Also

Concepts

Testing the Application