Parameterization and Correlation (Load Runner, Jmeter and VSTS)

 Welcome to Performance Testing Gyaan😀

In this post I will discuss about Parameterization and Correlation. The terms are used during scripting of performance test cases.

Parameterization: You will often be required to provide different values for the user input for each Vuser during load testing. These values (for example a username and password) can come from different data sources like a csv file, xml file, or from a database etc. This technique of replacing hard-coded values of user input with variables or parameters is called Parameterization.


Correlation: This is similar to parameterization except that the same concept is applied to parameterize values that are dynamically returned by the server, in its response to a request from the client. Examples are session id, security tokens etc.
These dynamic values are often required by the server to distinguish between the multiple users.

Load testing tools will provide different functions or ways in which parameterization and correlation can be achieved. Lets look how they are applied to Load Runner scripts-



Parameterization in Load Runner:

Correlation in Load Runner:
Functions are provided by load runner to capture and save dynamic values from a response. Each function works using some means of pattern matching like finding value between the left and right boundary of the text (This is similar as saying give me values that starts with some text and ends with some text)

Example: Consider below text-
                <input type="text" value="King"/>
Suppose you want to extract value King then left boundary will be= <input type="text" value="
and right boundary will be = 
"/>
The matched value will be = King

If you defined parameter name as 'c_KingName' to store the value 'King', then in your load runner script you can use default curly braces notation to use parameter values as, {c_KingName}. This will now become a placeholder for dynamic values when you run the script.

Click on each of the below correlation function to read more about them.
Parameterization in Jmeter:

The default syntax for using parameters in Jmeter is ${parameterName}.
You can read more about Parameterization in Jmeter on Blazemeter web site

Correlation in Jmeter:

In Jmeter correlation is achieved using Post Processors elements provided by Jmeter,  like Boundary Extractor, Regular Expression Extractor, JSON Extractor etc.
Read more on how to use them on PerfMatrix.com



Parameterization in Visual Studio:

The default syntax for using parameters in Visual Studio is {{parameterName}}.
For data driven testing, you need to first add Data Source to a web test. You can choose from Database, CSV file and XML file.
Example: If you have csv file with name 'Users' containing column 'user', you can refer the user as 
{{DataSource1.Users#csv.user}} in your request wherever required. Here DataSource1 is the name of the data source provided as in screenshot below.

Adding DataSource in visual studio 2017



Correlation in Visual Studio:

Extraction rule is a more familiar term when it comes to doing correlation in VSTS.
VSTS provides you to choose from a whole bunch of different types of extraction rules. The most widely used is Extract Text where you provide the starts with and ends with values and the value found will be stored inside the context parameter name provided. Refer screenshot below.

Extraction rules in visual studio 2017


Comments

Popular posts from this blog

Capture traffic from Android Emulator using Fiddler

Introduction to Performance Testing Basics