Export (0) Print
Expand All

Walkthrough: Recording and Running a Web Performance Test

In this walkthrough, you’ll use the tools of Visual Studio Ultimate to create a Web performance test from a browser recording and verify that it works correctly.

To create the Web performance test, you’ll record a browser session. The browser session is then displayed as a list of URLs in the Web Performance Test Editor. Each URL represents a Web request. For more information about Web performance tests, see Creating and Editing Web Performance Tests.

You’ll perform the following tasks:

  • Create a Web performance and load test project

  • Create a Web performance test from a browser recording

  • Run the Web performance test to verify that it works correctly

Here’s what you’ll need:

For this walkthrough, you will not make any changes to the Web application that you created in Walkthrough: Creating a Simple Web App, but you will need the address of the application.

To prepare for the walkthrough

  1. Open the Web app that you created in Walkthrough: Creating a Simple Web App.

  2. Press CTRL+F5 to run the Web application in the browser. You should see the first page.

    Note Note

    This starts the ASP.NET Development Server that runs the Web application your Web performance test will test. You will see the ASP.NET Development Server icon in the notification area, on the right side of the taskbar.

  3. Copy the address of your Web application to the clipboard or a notepad file. For example, the address might look like this: http://localhost:<PortNumber>/ColorWebApp/Default.aspx

  4. Close the browser.

To create the Web performance and load test project

  1. On the FILE menu, point to Add and then choose New Project.

    The Add New Project dialog box appears.

  2. Under Installed Templates, expand Visual Basic or Visual C# according to your preference, and select Test.

    Note Note

    You will not write any code in this walkthrough. The language that you choose for your project affects the language that is used when coded Web performance tests are generated.

  3. In the list of templates, choose Web Performance and Load Test Project.

  4. In the Name box, type ColorWebAppTest.

  5. In the Location box, type the name of the folder where you saved your Web app. For example, type the folder name C:\Users\<user name>\Documents\Visual Studio 11\Projects\ColorWebApp. You can also use the Browse button to locate the folder.

  6. Choose OK.

    The ColorWebAppTest project is added to your solution, which includes a Web performance test named WebTest1.webtest

  7. In Solution Explorer, select WebTest1.webtest and open the shortcut menu. Choose Rename and change the name of the Web performance test to ColorWebTest.webtest.

You record a Web performance test by browsing a Web site as if you were the end user. As you move through the site, requests are recorded and added to the Web performance test. For more information about how to record a Web performance test, see How to: Create a New Web Performance Test Using the Web Performance Test Recorder.

To record the Web performance test

  1. In Solution Explorer, select ColorWebTest.webtest, open the shortcut menu, and then choose Open.

    The Web Performance Test Editor displays for ColorWebTest.

  2. In the Web Performance Test Editor, choose Add Recording from the toolbar.

    Your web browser opens with the Web Test Recorder add-on displayed.

    Note Note

    If you don’t see the Web Test Recorder, you must configure the add-ons in your web browser to include it.

    Caution note Caution

    For the next procedure to work correctly, you must follow these steps in the order shown.

  3. In the browser's address bar, type the address of the Web application that you copied in a previous step, and choose ENTER.

    Note Note

    Visual Studio Ultimate begins to display the Web performance test URLs in the Web Performance Test Recorder as it is recording.

  4. Choose Red and choose Submit. The page with the Label that says Red should be displayed.

  5. Go back to the first page.

  6. Choose Blue and choose Submit. The page with the Label that says Blue should be displayed.

  7. Go back to the first page.

  8. Choose Stop on the Web Performance Test Recorder to stop recording.

    A dialog box displays the message Detecting dynamic parameters. It also displays a progress bar that shows the status of parameter detection in the HTTP responses that were received.

    Because the ColorWebApp does not have any dynamic parameters, the dialog box displays the message Did not detect any dynamic parameters to promote. The dialog box then closes.

    Note Note

    If dynamic parameters were detected, the Promote Dynamic Parameters to Web Test Parameters dialog box would appear, allowing you to select check boxes for the promotions that you want to apply when you run the Web performance test. For more information, see How to: Resolve Web Performance Test Playback Issues Caused by Dynamic Parameters.

    Now that Web performance test recording has ended, you will see your Web performance test in the Web Performance Test Editor as a list of URLs. You can now edit the test.

  9. Choose FILE and then choose Save ColorWebTest.webtest to save the newly recorded Web performance test.

The tree of URLs in the Web Performance Test Editor is called the request tree. Select various nodes in the request tree to view the properties associated with each request.

To view and modify request properties

  1. In the Web Performance Test Editor, go to the request tree and select the first instance of http://localhost:<PortNumber>/Default.aspx .

  2. In the Properties window, note the values of the different properties, for example URL, Follow Redirects and Think Time.

  3. Notice that Think Time for this request is a number greater than 0. This is how many seconds the default page waited until you selected Red and chose submit in step 4 of the previous procedure.

    For more information, see How to: Set Think Times to Simulate Human Pausing in a Web Performance Test.

  4. On the toolbar, choose Set Request Details.

    The Request Details dialog box appears. This dialog box lets you review and edit all the think times for the various web requests in the Web performance test.

  5. In the Think Time column, select each request with a think time value greater than 0 and change it to 1. This allows the test to play back with minimum delay caused by human interaction.

    For more information, see How to: Set Request Details in a Web Performance Test.

  6. Choose OK.

  7. In the request tree, expand the second instance of http://localhost:<PortNumber>/Default.aspx.

  8. Expand the Form Post Parameters folder.

    Notice that this request occurred after you selected blue and chose the submit button in the RadioButtonList1 and Button1 post parameters.

  9. Highlight the request node for the same second instance of http:// localhost:<PortNumber>/Default.aspx request with the red and submit post parameters and view the Expected response property in the Properties window to help identify the request.

  10. In the Properties window, select the text box next to Reporting Name and type Red.

  11. Highlight the request node for the fourth instance of http:// localhost:<PortNumber>/Default.aspx.

  12. In the Properties window, select the text box next to the Reporting Name property and type Blue.

    Using the Reporting Name property will make it much easier to identify requests in the Web Performance Test Analyzer when it is run in the next procedure. Reporting names also make it easier for stakeholders to identify requests in reports.

    For more information, see How to: Use Reporting Names to Easily Identify Requests in a Web Performance Test and How to: Create Load Test Performance Reports Using Microsoft Excel.

  13. Choose FILE and then choose Save ColorWebTest.webtest to save the newly recorded Web performance test.

    To learn more about modifying web requests and Web performance tests, see Customizing Web Performance Test Recordings Using Web Performance Test Editor.

You can now run the Web performance test to verify it that it works correctly. Each web request that you recorded will be replayed, and the results will be collected. For more information, see Running Web Performance Tests.

To verify the Web performance test

  1. In the Web Performance Test Editor, choose Run Test on the toolbar.

    The test starts to run, and a session of the Web Performance Test Results Viewer displays each request in the test. The Test Results window displays the result for the entire test. Next, you will verify the results.

  2. In the Web Performance Test Results Viewer select the first request in the list.

    You should see a green check mark to the left of the request. A green check mark indicates that the request succeeded. You should see the first page of the Web application in the bottom pane.

    You will see either a green check mark or a red X to the left of the request. A red X indicates that the request failed. This will cause the result for the entire test to fail, after the test has finished. By default, if a request fails, the rest of the test is not aborted and does continue. For example, an external web request might fail because of firewall problem. However, the next request will still be attempted and the test will continue to run.

    Tip Tip

    If you cannot access websites outside your local network, you might have to specify a proxy server in your Web performance test. For more information on firewall issues, see How to: Specify a Proxy Server for a Web Performance Test.

  3. Notice how easily recognizable the two request called Red and Blue are using the Reporting Name assigned in the previous procedure. If they had not been used, each request would be identically named.

  4. To run your test a second time, choose Click here to run again at the top of the Web Performance Test Results Viewer.

In this walkthrough you recorded and ran a Web performance test. Now that you have a Web performance test, you can add either of the following enhancements, if they are needed:

Show:
© 2015 Microsoft