Walkthrough: Creating and Running a Load Test
In this walkthrough you create a load test, which consists of one or more Web tests.
This walkthrough steps you through creating and then running a load test using the tools of the Visual Studio Team Test suite. A load test is a container of Web tests and unit tests. You create load tests with the New Load Test Wizard. For more information about load tests, see Working with Load Tests.
A load test also exposes many run-time properties that can be modified to generate the desired load simulation. In this walkthrough, you use the load test wizard to add a Web test to a load test. For more information about Web tests, see Working with Web Tests.
This walkthrough requires an existing a Web test or several Web tests that you can add to a load test.
In this walkthrough, you will complete the following tasks:
Create or locate a Web application to use in a Web test.
Create a Web test to use in the load test.
Create a load test.
Change some of the load test settings.
Run a load test.
A Web application under development. Generally, load tests that consist of Web tests are used to test a Web application that is under development and not yet ready for production. Therefore, it is assumed that you have such a Web application. Any prerequisites for the Web application are also your responsibility, such as ASP.NET, a Web Server, IIS, and any other backend data support such as Microsoft SQL Server.
For more information, see Walkthrough: Creating a Simple Web Application.
Optionally, you can use a starter kit from ASP.NET Starter Kits. Follow the instructions on that site for the Setup program and any troubleshooting that might be required.
Although a load test can contain both Web tests and unit tests, this walkthrough focuses on a load test that contains a Web test.
A Web test. See Walkthrough: Recording and Running a Web Test.
To prepare the walkthrough
Identify the pre-production Web application that you have under development.
Optionally, install a starter kit from ASP.NET Starter Kits. You can set this up on your local computer to run these walkthroughs.
If you have not created a Web test to use for this walkthrough, see Walkthrough: Recording and Running a Web Test. The remaining steps assume a Web test named WebTest1.webtest.
Start the New Load Test Wizard
Open the solution that contains your Web test, WebTest1.webtest.
For more information, see Walkthrough: Recording and Running a Web Test.
In Solution Explorer, right-click the test project node. Click Add, and then click Load Test.
The New Load Test Wizard starts.
The Welcome page of the New Load Test Wizard is the first page.
Edit settings for load test scenario
Type in a name for your scenario. A scenario is a grouping mechanism. It consists of a set of tests and the properties for running those tests under load.
Set the Time Profile Think to Use normal distribution centered on recorded think times. Think times represent the time that a user would ponder a Web page before going on to the next page. For more information, see How to: Set Think Times in a Web Test.
Click Next when you are finished.
Edit load pattern setting for test scenario
Click Step load.
You can choose from two types of load patterns: constant and step. Each type has its function in load testing, but for the purposes of this walkthrough choose Step load.
Set Start user count to 10 users.
Set Step duration to 10 seconds.
Set Step user count to 10 users/step.
Set Maximum user count to 100 users.
Add test to a scenario
The next step is to Add tests to a load test scenario and edit test mix.
Click Add to select tests. Click the tests in the Available Tests pane and then click the arrow to add them to the Selected Tests pane.
When you have finished adding tests, click OK.
You are presented with the test mix. You can use the sliders to adjust the test distribution.
After you have adjusted the sliders to your preferred mix, click Next.
Select browser mix for test scenario
From the drop-down list, select the IE6 browser to add to the mix.
You can add more browsers. Use the sliders to adjust the test distribution and weighting.
Select network mix for test scenario
Select the LAN connection type to add to the network bandwidth mix.
You can add more network types. Use the sliders to adjust the test distribution and weighting.
Specify computers to monitor with counter sets during load test run
Select the computers to monitor during test runs by clicking Add Computer and type the name of the server that hosts the non-production Web site that you targeted earlier. By adding the host computer name, you gather performance information that is important in your load test.
On each server that you monitor, you must have sufficient user permissions to run performance monitors. Otherwise, errors are generated.
You can add a separate entry for a computer that hosts the SQL database for the site. If you choose not to add any computers, only local load counters are added to your tests.
Select Counter sets that you want to monitor. A set of predefined counter sets that add specific performance monitors to your load test are displayed.
Put check marks in the selection boxes for ASP.NETnet and IIS for this test if the site you are testing is runs on an ASP.NET server.
Edit run setting for load test
Set Run Duration to 2 minutes in order to smoke test your load test.
When you build your Web tests and load tests, it is a good practice to validate that everything is correctly configured and running as expected by running a short, light load test. This process is referred to as smoke testing.
Click Finish. Your Load test is opened in the Load Test Editor.
After you have created the Load test, run it to view how your Web site responds to the load simulation. While a load test is running, you see the Load Test Monitor window.
To run the Load test
With a Load test open in the Load Test Editor, click the green Run button. Your load test starts to run.
To maximize the viewable area, click View from Visual Studio menu, and then click Full Screen.
If your test simulation exceeds any thresholds, icons appear in the tree control nodes to indicate a threshold violation. Errors have a red circle overlay, warnings have a yellow triangle overlay. You can find a counter that exceeded the threshold and graph it by dragging the icon onto the graph. This can be done while the test is running. Notice which computer it is on by observing the Computer column in the legend.