Sdílet prostřednictvím


Walkthrough: Install Test Controller and Test Agents for Visual Studio Automated Tests

This topic applies to:

Visual Studio Test Professional

Visual Studio 2010 Ultimate

Visual Studio 2010 Premium

Visual Studio Professional

Visual Studio Express

Topic applies Topic applies Topic applies Topic applies Topic does not apply

In this walkthrough you will learn the procedures that are used to install a test controller and a test agent. The walkthrough also demonstrates how to configure a test setting that uses the test controller and test agent to distribute testing across several machines. Additionally, this walkthrough demonstrates how to add diagnostic and data adapters to the test setting.

In this walkthrough, you will complete the following tasks:

  • Set up a test controller and a test agent to use for testing across multiple machines from Visual Studio.

  • Create a test setting that uses the test controller and data and diagnostic adapters and run your test.

Prerequisites

  • The "Microsoft Visual Studio Agents" CD.

  • (Optional) A second machine to install the test controller and test agent. Otherwise, you can install the test controller and agent on the same machine where you installed Visual Studio.

Install Test Controller and Test Agent

The next two procedures provide the steps used to install a test controller and a test agent.

Install a Test Controller

To install a test controller, you must be a member of the Administrators security group on the machines. For more information about how to install test controllers, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

To install a test controller

Install a Test Agent

To install a test agent, you must be a member of the Administrators security group on the computer.

The user whom you add to start the service or process for the test agent must also be a member of the TeamTestAgentService group on the computer for the test controller for this agent.

Poznámka

If this user is the current user, when you add this user to the test controller, you must log off or restart the computer.

For more information about how to install test agents, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

To install a test agent

Using the Test Controller and Test Agent in Visual Studio

In this procedure, you will create a test setting in Visual Studio to include the test controller you installed, and specify a role and what data and diagnostic adapters the test agent will use.

To add a test setting in Visual Studio using the test controller and test agent

  1. In Solution Explorer, right-click Solution Items, point to Add, and then click New Item.

    The Add New Item dialog box appears.

  2. In the Installed Templates pane, click Test Settings.

  3. In the Name box, type TestSettingDistributedTestWalkthrough.

  4. Click Add.

    The new test TestSettingDistributedTestWalkthrough.testsettings file appears in Solution Explorer, under the Solution Items folder.

    The Test Settings dialog box is displayed. The General page is selected.

    You can now edit and save test settings values.

    Poznámka

    Each test settings that you create is listed as a choice for the Select Active Test Settings and Edit Test Settings options on the Test menu.

  5. Under Name, type the name for the test settings.

  6. Under Description, type Distributed test settings.

  7. Leave Default naming scheme selected.

  8. Click Roles.

    The Roles page is displayed.

  9. To run your test remotely, use the Test execution method drop-down list and select Remote execution.

  10. In the Controller drop-down list, type the computer name of the test controller that you created in the Install a Test Controller procedure.

    Poznámka

    If this is the first time that you are adding a controller, there are no controllers listed in the drop-down list. The list is populated by previous controllers that you have specified in other test settings.

  11. Under Roles, click Add.

  12. In the highlighted row under the Name column, type Distributed test.

  13. Click Data and Diagnostics.

    The Data and Diagnostics page is displayed.

  14. Under Role, verify that the Distributed test role is selected.

  15. Under Data and Diagnostic for select role, select the IntelliTrace and System Information adapters.

    For information about these adapters and other adapters that you can use in a test setting, see Create Test Settings to Run Automated Tests from Visual Studio.

  16. Click Hosts.

  17. (Optional) If your machine is running under a 64-bit version of Microsoft Windows, and you compiled your test using the Any CPU configuration, use the Run test in 32 bit or 64 bit process drop-down list and select Run tests in 64 bit process on 64 bit machine.

    Tip

    For maximum flexibility, you should compile your test projects with the Any CPU configuration. Then you can run on both 32 and 64 bit agents. There is no advantage to compiling test projects with the 64-bit configuration.

  18. To save the new test settings, click Apply.

  19. Click Close.

  20. On the Test menu, select Select Active Test Settings and then click TestSettingDistributedTestWalkthrough.testsettings.

  21. Run your test as usual.

    When the test controller processes unit tests and coded UI tests, the test controller divides the tests into groups of 100 and sends them to a test agent machine. For example, if you have 250 unit tests and three test agents, the first 100 unit tests will be sent to agent1, the next 100 unit tests will be sent to agent2 and the remaining 50 unit tests will be sent to agent3.

    For more information about how to create test settings to use in Visual Studio, see Create Test Settings to Run Automated Tests from Visual Studio.

See Also

Tasks

Walkthrough: Using a Test Controller and Test Agents in a Load Test

Concepts

Installing and Configuring Visual Studio Agents and Test and Build Controllers

Setting Up Machines and Collecting Diagnostic Information Using Test Settings

Setting Up Test Machines to Run Tests or Collect Data

Test Controller and Test Agent Requirements