Export (0) Print
Expand All

How to: Resolve Web Performance Test Playback Issues Caused by Dynamic Parameters

This topic applies to:

Visual Studio Ultimate

Visual Studio Premium

Visual Studio Professional 

Visual Studio Express

Topic appliesTopic does not applyTopic does not applyTopic does not apply

Some Web sites and applications use dynamic parameters in one or more of their Web requests. A dynamic parameter is a parameter whose value is generated every time that a user runs the application. A dynamic parameter can cause your Web performance test playback to fail because the dynamic value will likely be different every time that the test is run. Therefore, you cannot play back recorded values. An example of a dynamic parameter is a session ID, which usually gets its value changed between 5 to 30 minutes.

The Web performance test recorder and playback engine automatically handle the most common types of dynamic parameters:

  • Dynamic parameter values set in cookie value. The Web performance test engine automatically handles these during playback.

  • Dynamic parameter values set in hidden fields on HTML pages, such as ASP.NET view state. These are automatically handled by the recorder adding hidden field extraction rules to the test.

  • Dynamic parameter values set as query string or form post parameters. These are handled through dynamic parameter detection when the test is completed.

However, there are still some forms of dynamic parameters that are not automatically handled. To handle these parameters correctly, you can add extraction rules to dynamic parameters in your Web performance tests. However, before you add an extraction rule, you have to locate where a dynamic parameter is initialized. You can use the following features in Web performance tests to help you locate and correct playback issues that are caused by dynamic parameters:

  • Use Quick find during playback in the Web Performance Test Results Viewer   You can use the Quick Find feature in the Web Performance Test Results Viewer to isolate dynamic parameters. You have to determine which of the parameter's variables for the failed request are dynamic. If you are familiar with the Web application that you are testing, this might be easy; otherwise, you might have to investigate each parameter. If the query string's parameter's value is only found in the request you are currently debugging, and not in other requests, then it is likely a dynamic parameter. For more information, see Web Performance Test Results Viewer Overview.

  • Use Quick Find in the Web recording results log   After you isolate a suspected dynamic parameter in the Web Performance Test Results Viewer, you can use Quick Find in the recording results log to discover where the dynamic property is being initialized by the Web site. The recording results log shows what the browser sends and receives during the Web performance test.

  • Add an extraction rule in playback   After you isolate a dynamic parameter that causes a playback error, you can add an extraction rule to fix it using the Add Extraction Rule feature in the Web Performance Test Results Viewer.

To use quick find in the playback recording

  1. In the Web Performance Test Results Viewer, click the request that you suspect is failing because of a dynamic parameter issue.

  2. Click the Request tab.

  3. Scroll down until you find QueryString Parameters and Post Parameters under the Name column.

  4. Right-click the parameter that you suspect might be dynamic and select Quick Find.

    The Find dialog box appears.

  5. The parameters value is displayed under Find what. Delete the value that the parameter is assigned, but leave the parameter name and the equal sign. This is so that you can identify where the value of the parameter is first assigned. For example, change "MyQueryString=cwpvcbdnpqxngvuhn34gda5u" to "MyQueryString=".

  6. Because the value of the dynamic parameter is assigned in a request that was made previous to the one that reported the error, select the Search up check box and click Find Next.

  7. Repeat clicking Find Next until you locate where the value of the parameter is assigned. You might notice that the values between the two requests are not the same or that the value is assigned by a dynamic value when it is initialized.

  8. If the parameter value of the query string is found only in the request that you are currently debugging, and not in other requests, it is likely not a dynamic parameter.

  9. Once you have located where the dynamic parameter is assigned its value, close the Find dialog box.

    NoteNote

    You can also right-click the suspect parameter in the Web Performance Test Results Viewer and select Go to Web Test. The Web Performance Test Editor is displayed with the specified parameter highlighted.

    Next, you will find the location where the dynamic parameter is being initialized in the Web performance tests recording log.

To view the recording results in playback

  1. In the toolbar of the Web Performance Test Results Viewer, click the Recorded Result button.

    The recorded results are displayed in a separate tab that is designated with [Recorded] appended to the Web performance tests name in another instance of the Web Performance Test Results Viewer.

  2. Go to the location in the Web performance test where the dynamic parameter was assigned its initial value in one of the following ways:

    • Go to the location in the Web performance test that is identified in step 8 of the previous procedure.

      -or-

    • Repeat the steps that were specified in the previous procedure:

    1. Click the Request tab.

    2. Scroll down until you find QueryString Parameters and Post Parameters under the Name column.

    3. Right-click the parameter that you suspect might be dynamic and select Quick Find.

    4. The Find dialog box appears.

    5. The parameters value is displayed under Find what. Delete the value that the parameter is assigned, but leave the parameter name and the equal sign. This is so that you can identify where the value of the parameter is first assigned. For example, change "MyQueryString=cwpvcbdnpqxngvuhn34gda5u" to "MyQueryString=".

    6. Because the value of the dynamic parameter is assigned in a referring request that was made previous to the one that reported the error, select the Search up check box and click Find Next.

    7. Repeat clicking Find Next until you locate where the value of the parameter is assigned in the Response tab of one of the previous requests.

    8. Close the Find dialog box.

    Next, you will add an extraction rule from playback in the Web Performance Test Results Viewer to the dynamic property you identified.

To add an extraction rule from playback

  1. When you have found the dynamic parameter in the response of the referring requests, as described in the previous procedure, right-click the dynamic parameter value that you want to extract and select Add Extraction Rule.

    The Web Performance Test Editor is displayed with the new extraction rule selected in the applicable Web request and is assigned a parameter value (for example, 'Param0').

    The Web Performance Test Editor is displayed with the new extraction rule.

  2. Right-click on the root node of the Web performance test and select Find and Replace in Request.

    The Find and Replace in Request dialog box is displayed.

  3. In the Find What drop-down list, select the value that represents the text that you selected for the extraction rule, or type the text.

  4. In the Replace with drop-down list, select the value that you extracted into the context. For example, when you added the extraction rule, if you extracted the value into a context parameter named Param0, in the Replace with drop-down list you would either select or type {{Param0}}.

  5. Click Find Next until you locate the QueryString parameter by using the dynamic parameter value and then click Replace.

  6. In the Properties window, click the down arrow on the Value property and select the value that was created in the new extraction rule (for example 'Param0').

  7. Repeat steps 2 and 3 for other QueryStringParameters and Post Parameters values in applicable Web requests as required.

  8. In Web Performance Test Editor, run the Web performance test to verify that the playback now functions correctly.

Community Additions

ADD
Show:
© 2014 Microsoft