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
Microsoft Visual Studio 2010 Ultimate
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 that you are using Microsoft Visual Studio 2010 Ultimate on.
(Optional) Purchase virtual user packs to add to your test controller. Virtual user packs can be purchased where you purchased Microsoft Visual Studio 2010 Ultimate.
A simple load test that you can experiment with. If you do not have such a load test, you can create one by following the procedures in the following three walkthroughs first:
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
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.
Click Install Visual Studio Test Controller 2010.
The Microsoft Visual Studio Test Controller 2010 Installation page appears.
Click Next.
The Start page is displayed.
Review the License Terms, select I have read and accept the license terms, if appropriate, and then click Next.
The Options page is displayed.
(Optional) To install it in a different location, click Browse to select a different installation folder.
Click Install to start the installation.
The Installing Components page is displayed. When the installation is finished, the Finish Page is displayed.
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.
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.
To configure your test controller for load testing, select Configure for load testing.
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.
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.
(Optional) Add virtual user licenses:
Click Add and type your virtual user license key in the text box under License key column.
Under the License count column, type the number of license that you purchased. The number of virtual users is updated in increments of 1000.
Click OK.
The number of virtual users is updated under the Number of virtual users column.
Click Close
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.
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
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.
Click Install Visual Studio Test Agent 2010.
The Microsoft Visual Studio Test Agent 2010 Installation page appears.
Click Next.
The Start page is displayed.
Review the License Terms, select I have read and accept the license terms, if appropriate, and then click Next.
The Options page is displayed.
(Optional) Click Browse to select a different installation folder.
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.
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.
Click Run Options.
Under Run the test agent as, select Service.
Click Next.
Enter the details about the user when the test agent starts as a service.
Type the name in User name.
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.
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.
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.
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
Start Microsoft Visual Studio 2010 Ultimate.
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
In Solution Explorer, right-click Solution Items and then point to Add, and then click New Item.
The Add New Item dialog box appears.
In the Installed Templates pane, click Test Settings.
In the Name box, type TestSettingDistributedLoadTestWalkthrough.
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.
Under Name, type the name for the test settings.
Under Description, type Distributed load test settings.
Leave Default naming scheme selected.
Click Roles.
The Roles page is displayed.
To run the ColorWebAppTest Web performance test remotely use the Test execution method drop-down list and select Remote execution.
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.
Under Roles, click Add.
In the highlighted row under the Name column, type Distributed load test.
Click Data and Diagnostics.
The Data and Diagnostics page is displayed.
Under Role, verify that the Distributed load test role is selected.
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.
Click Hosts.
(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.
To save the new test settings, click Apply.
Click Close.
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
With load test open in the Load Test Editor, click the Run button. Your load test starts to run.
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
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
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