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

In this walkthrough you will learn the procedures that are used to configure a test setting that uses a test controller and test agents to distribute a load test across several machines. Additionally, this walkthrough demonstrates how to add virtual user license packs to the test controller, and how to add diagnostic and data adapters to the test setting.

This walkthrough steps that you through creating and then running a distributed load test using Visual Studio 2010 Ultimate.

In this walkthrough, you will complete the following tasks:

  • Set up a test controller and a test agent.

  • (Optional) Add virtual user licenses to the test controller.

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

  • Run the load test across the distributed machines.

Prerequisites

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 installing test controllers, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

To install a test controller to use for the distributed load test

  1. On either the machine that you have Microsoft Visual Studio 2010 Ultimate installed on, or preferably on a second machine that you can install the test controller on, load the "Microsoft Visual Studio Agents" CD and then start setup.exe located in the root folder.

    The Visual Studio Agents 2010 Setup page is displayed.

  2. Click Install Visual Studio Test Controller 2010.

    The Microsoft Visual Studio Test Controller 2010 Installation page appears.

  3. Click Next.

    The Start page is displayed.

  4. Review the License Terms, select I have read and accept the license terms, if appropriate, and then click Next.

    The Options page is displayed.

  5. (Optional) To install it in a different location, click Browse to select a different installation folder.

  6. Click Install to start the installation.

    The Installing Components page is displayed. When the installation is finished, the Finish Page is displayed.

  7. To configure the test controller that you have installed, select Configure test controller now. Then click Configure to start the Test Controller Configuration tool.

    The Configure Test Controller dialog box is displayed.

  8. Select the user to use as the logon account for your test controller service.

    Important user account information:

    • Null passwords are not supported for user accounts.

    • If you want to use the IntelliTrace or the network emulation data and diagnostic adapter, the user account must be a member of the Administrators group.

    • If the agent user name is not in the agent service it will try to add it, which requires permissions on the test controller.

    • The user trying to use the test controller must be in the test controller's Users account or they will not be able to run the tests against the controller.

  9. To configure your test controller for load testing, select Configure for load testing.

  10. Type your SQL Server instance in Create load test results database in the following SQL Server instance.

    Note

    If you do not have SQL Server installed, you can use SQL Express included in Microsoft Visual Studio 2010 Ultimate. For more information, see How to: Create a Load Test Results Repository Using SQL. For more information about sizing considerations, see Using Test Controllers and Test Agents with Load Tests.

  11. To manage the virtual user licenses for load testing with a test controller, click Manage virtual user licenses.

    Note

    Visual Studio Ultimate lets you use up to 250 virtual users on a local load test run. If your load testing requires more virtual users, or you want to use remote machines, you must purchase Visual Studio Load Test Virtual User Pack 2010. You can purchase Visual Studio Load Test Virtual User Pack 2010 where you purchased Visual Studio Ultimate. For more information, see Managing Your Virtual User Licenses for Load Testing with a Test Controller and Configuring Test Controllers and Test Agents for Load Testing.

    Note

    The Visual Studio 2010 Load Test Feature Pack provides active Microsoft Visual Studio Ultimate 2010 with MSDN subscribers a unique Visual Studio Load Test Virtual User Pack 2010 license key to generate unlimited virtual users.

    To download the feature pack, which is available for MSDN Subscribers only, visit MSDN Subscribers Downloads. For more information about the feature pack, see Microsoft Visual Studio 2010 Load Test Feature Pack.

  12. (Optional) Add virtual user licenses:

    1. Click Add and type your virtual user license key in the text box under License key column.

    2. Under the License count column, type the number of license that you purchased. The number of virtual users is updated in increments of 1000.

    3. Click OK.

    4. The number of virtual users is updated under the Number of virtual users column.

    5. Click Close

  13. To apply your changes, click Apply Settings.

    A Configuration summary dialog box is displayed. It shows the status of each step that is required to configure your test controller.

  14. To close the Configuration summary dialog box, click Close. Then click Close again to close the Test Controller Configuration Tool.

    The Visual Studio Agents 2010 Setup dialog box is displayed. From here, you can install any other components that you require on this computer.

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.

Note

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

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

Warning

Installing a test agent on a machine that is part of a Network Load Balancer setup is not supported.

To install a test agent to add additional stress on your load test

  1. On either the machine that you have Microsoft Visual Studio 2010 Ultimate installed on, or preferably the second machine that you installed the test controller on, load the "Microsoft Visual Studio Agents" CD and then start setup.exe located in the root folder.

    Note

    You can optionally install the test agent on a third machine too. A Test controller can control several agents on different machines.

    The Visual Studio Agents 2010 page appears.

  2. Click Install Visual Studio Test Agent 2010.

    The Microsoft Visual Studio Test Agent 2010 Installation page appears.

  3. Click Next.

    The Start page is displayed.

  4. Review the License Terms, select I have read and accept the license terms, if appropriate, and then click Next.

    The Options page is displayed.

  5. (Optional) Click Browse to select a different installation folder.

  6. Click Install to start the installation.

    The Installing Components page is displayed. The test agent install requires performance tools to be installed to collect performance data when tests are run. When the installation is finished, the Finish Page is displayed.

  7. To configure the test agent you have installed, select Configure test agent now. Then click Configure to start the Test Agent Configuration tool.

    The Configure Test Agent dialog box is displayed.

  8. Click Run Options.

  9. Under Run the test agent as, select Service.

  10. Click Next.

  11. Enter the details about the user when the test agent starts as a service.

    1. Type the name in User name.

    2. Type the password in Password.

      Make sure that user account is a member of the Administrators group in order to be able to use the IntelliTrace collector and network emulation you will specify in the procedure Modify the Test Setting to Include Diagnostic Data Adapters.

      Note

      Null passwords are not supported for user accounts.

  12. To register this agent with the test controller you installed, select Register with test controller. In Register the test agent with the following test controller, type the name of the machine you installed the test controller on and optionally follow it with a colon (:) and the port number that you are using. For example, type Contoller1:6901.

    Note

    The default port number is 6901.

  13. To apply your changes, click Apply Settings.

    A Configuration summary dialog box is displayed. It shows the status of each step that is required to configure your test agent.

    Note

    The last step in the installation process resets the network adapter. This may cause a network outage for brief period of time. This is expected behavior.

  14. To close the Configuration summary dialog box, click Close. Then click Close, to close the Test Agent Configuration Tool.

    Note

    There is a notification area icon that runs on the computer for a test agent that is running as a process. It shows the status of the test agent. You can start, stop or restart the agent if it is running as a process using this tool. To start the test agent as a process if it is not running, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Visual Studio Test Agent 2010.

Open or Create a load Test

With the test controller and test agent installed, you can now start Microsoft Visual Studio 2010 Ultimate and specify the load test you want to stress using the test agent.

To prepare the walkthrough by opening or creating a load test

  1. Start Microsoft Visual Studio 2010 Ultimate.

  2. Open the ColorWebApp solution containing the load test that results from conducting the steps in the three walkthroughs mentioned at the top of this topic in the prerequisites section.

    -or-

    Create a test project with a simple load test that you can experiment with.

    The remaining steps assume a Web application named ColorWebApp and a Web performance test named ColorWebAppTest.webtest

Create a new Test Setting that Uses the Test Controller and Test Agents and Data and Diagnostic adapters

In this procedure, you will create a test setting to include the test controller you installed, specify a role and what data and diagnostic adapters the test agent will use. For more information about creating a test setting for a distributed load test, see How to: Create a Test Setting for a Distributed Load Test.

To add a test settings for a distributed load test

  1. In Solution Explorer, right-click Solution Items and then 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 TestSettingDistributedLoadTestWalkthrough.

  4. Click Add.

    The new test TestSettingDistributedLoadTestWalkthrough.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.

    Note

    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 load test settings.

  7. Leave Default naming scheme selected.

  8. Click Roles.

    The Roles page is displayed.

  9. To run the ColorWebAppTest Web performance 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 you created in the Setup a Test Controller procedure.

    Note

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

  11. Under Roles, click Add.

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

  13. Click Data and Diagnostics.

    The Data and Diagnostics page is displayed.

  14. Under Role, verify that the Distributed load 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 you can use in a distributed load test, see How to: Create a Test Setting for a Distributed Load Test.

  16. Click Hosts.

  17. (Optional) If your machine is running under a 64-bit version of Microsoft Windows, and you compiled the ColorWebAppTest.webtest 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 TestSettingDistributedLoadTestWalkthrough.testsettings.

Running the Distributed Load Test and Viewing the Data and Diagnostic Adapter Reports

You can now run the distributed load test and analyze the IntelliTrace and system information reports that are generated.

To run the load test

  1. With load test open in the Load Test Editor, click the Run button. Your load test starts to run.

  2. After a load test completes, in the Load Test Analyzer's toolbar, click View Data and Diagnostic attachments.

    The Choose Diagnostic Data Adapter Attachment dialog box is displayed. Note that the name of the agent is displayed as a prefix to the adapter, for example [AgentMachine1]: SystemInformation.xml.

    [AgentMachine1]: QTAgent32_100216_085903820_3320.iTrace

  3. Select the diagnostic data adapter attachment that you want to analyze and click OK.

    The information collect by the agent is displayed accordingly.

See Also

Tasks

How to: Create a Test Setting for a Distributed Load Test

How to: Add Virtual User License Keys for Load Testing

How to: Specify 64-Bit Process Using Test Settings

Concepts

Installing and Configuring Visual Studio Agents and Test and Build Controllers

Using Test Controllers and Test Agents with Load Tests

Configuring Test Controllers and Test Agents for Load Testing

Considerations for Load Tests

Load Test Analyzer Overview

Running Load Tests

Setting Up Machines and Collecting Diagnostic Information Using Test Settings

Other Resources

Distributing Load Tests Across Multiple Test Machines Using Test Controllers and Test Agents

Getting Started with Load and Web Performance Test Walkthroughs