Home > Load Testing > Visual Studio Performance Testing Tip#2: Extract a value by Id

Visual Studio Performance Testing Tip#2: Extract a value by Id


I do few performance testing gigs a year. One of the most frequently think I do is extracting a value of an element by id from the response of a request. The extracted value is used in subsequent requests

For example, let’s say I go www.lajak.com and there is a HTML element declared as follows:

<input id=”testId” value=”testValue” />

There few ways to extract the value of the input. The most reliable way to extract the value using Visual Studio is to use the “Extract Attribute Value” Extraction Rule.

Right click on the request you want to extract the value from its response and click on Add Extraction Rule

Select Extract Attribute Value

Enter a Context Parameter Name

Tag Name is “input” which is the name of the element

Match Attribute name is the name of the attribute we want to search by. In our example, we are trying to an element’s value by id. Hence the value of the property is id

Match Attribute value is the value of the above attribute. In our example, the value is testid

Attribute name, is the attribute name that we want get its value. In our example it is value

The above extraction rule should extract “testValue” and save it into TestIdValue.

In subsequent requests, bind to your querystring or form to TestIdValue parameter

About Lajak Technologies

A consulting firm in Ottawa, Ontario that provides services related to Microsoft technologies, Team Foundation Server, DevOps practices, security and more. Contact us today to help you solving your complex software problems. Visit us at http://www.lajak.com.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: