Dela via


Setting Up Test Machines to Run Tests or Collect Data

Using Microsoft Visual Studio 2010, you can run your tests and also collect data and diagnostics when you run your tests. You use test settings to specify the data and diagnostics that you want to collect. You can even select diagnostic data adapters that affect the way that your test machine performs. For example, you might want to create a video recording of your desktop while you run your test, or collect system information about your Web server. Additionally, you might want to emulate a slow network to impose a bottleneck on the system.

To run tests remotely on multiple machines, or collect data and diagnostics remotely you must use a test controller and test agents. The test controller runs as a service and assigns tests to a test agent to run. In addition it can tell the test agent what data or diagnostics need to be collected. You can manage the test controller and agents by using Microsoft Visual Studio 2010, or if you register the test controller with Team Foundation Server, then you can manage the controller and agents by using Microsoft Test Manager.

If you have a multitier application, you define a role for each tier to use to run tests or collect data. For example, if you have an application that consists of a Web server, a database server, and a desktop client, you would define one role for each of these. The desktop client can run the tests and collect data locally, and the other roles can collect any data that you require on the machine that you assign to that role. You can also use roles if you have a simple application that runs on a remote machine instead of a local machine.

If you are using Microsoft Test Manager, you can create an environment for this set of roles. For example, you can install a test controller and register it with Team Foundation Server. You can then install nine test agents on nine different physical or virtual machines. With this test controller and agents you can create three environments each with a desktop client, database server and Web server roles. You select a machine with a test agent to use for each role in your application for this environment.

Note

You can assign multiple machines to a single role in case one of the machines is not available. You might also do this if you require multiple machines for that role in your environment.

The following sections of this topic provide more information about the ways to run tests and collect data, based on the type of tests that you run and whether you want to use an environment:

  • Manual Tests

  • Automated Tests

  • Environments

Manual Tests

It is recommended that you run your manual tests on a local machine that is not part of the environment. You can collect data or affect a test machine for your manual tests in the following ways:

  • Collect data on the local machine using default test settings

  • Collect data on a local machine specifying the data to collect

  • Collect data on local and remote tiers of your application

For more information about how to set up your test settings and environments for these situations, see Create Test Settings for Manual Tests.

Automated Tests

If you plan to run your automated tests by using Microsoft Test Manager, you must use a physical or virtual environment that contains a set of roles to run your tests from your test plan.

If you plan to run automated tests by using Microsoft Visual Studio 2010, you can just run your automated tests on your local machine and use test settings to collect data locally. If you want to collect data or affect the test machine for specific parts of a multitier application, you can select a test controller and test agents and add roles to use in your test settings.

The following illustration shows a test controller and test agents that are installed on a machine for each role in an application under test and the tasks that the test agent can perform. The test controller manages the test agents that are registered to it.

Important

If you want to use a test controller as part of an environment, you must register it with Team Foundation Server, as shown in the following illustration. However, if you want to use a test controller from Microsoft Visual Studio 2010, do not register the test controller with Team Foundation Server.

Test Controller and Test Agents

Warning

The test agents and test controllers can be installed in different domains if your testing setup requires it.

Environments

You can create physical or virtual environments by using Microsoft Test Manager. A physical environment might use physical computers or virtual machines. A virtual environment uses only virtual machines:

  • To create a physical environment, you must install one or many test controllers on available computers and register each of them with Team Foundation Server. You must then install test agents on your computers. Each computer that is available to use in the environment is called a machine.

  • If you are using Visual Studio Lab Management, you can create virtual environments. These environments are created by using virtual machines or templates. If you want to run tests by using Microsoft Test Manager, you can manually install test agents on the virtual machines, and then provide the name of a test controller in your environment. For more information about virtual environments, see Creating Virtual Environments.

When you create an environment, you select a test controller to use for that environment. Then you must decide the roles that you require in your environment. A role specifies the purpose of a computer in the environment. For example, a specific role could be Web Server or Desktop Client. You select which machines to use in your environment and assign a role to that machine.

Tasks

Use the following topics to help set up your machines to run tests and collect data.

Tasks

Associated topics

Installing test controllers and test agents to use for running tests and collecting data: You can use test controllers in your test settings that you create by using Microsoft Visual Studio 2010. Or you can use test controllers with your environments.

Setting up your physical environments for running tests: You can use a physical environment to run your tests. The physical environment consists of test agents and test controllers that are installed on physical machines or virtual machines that are used for the set of roles that are defined in your environment.

Setting up your virtual environments for running tests: If you are using Lab Management, you can use a virtual environment to run your tests. The virtual environment consists of test agents and lab agents that are installed on virtual machines. If you want to automatically deploy new builds to the machines in your environments, you can also install a build agent on your virtual machines.

Set up how to run tests or collect data by using test settings: You can create test settings and select the set of roles for your application under test and then select an environment that contains these roles in your test plan. You can also override these settings in your test plan for specific test runs.

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

Running Tests