How to handle dynamic boundaries in LoadRunner using Text Flags


To do correlation in LoadRunner we need both Left Boundary and Right Boundary of the dynamic value which we are planning to capture, but if there is a situation where boundaries are also dynamic..?

Technique to do correlation when boundaries are dynamic

For complex changes, we first capture a subset of the server response, based on some unique boundaries identified, and then with the aid of custom built-in Text Flags in the correlation functions, we get the desired substring out of the captured string.
Simple solution for this is to use “Text Flags”, where I provide you with few different scenarios with solutions

Type 1:
Consider that you have a situation where you need to capture text/string DynamicValue, but the problem here is left boundary of the string changing every time you replay. For e.g. you get the left boundary as abcXdef, where X ranges between 0 and 9 as

abc0def=DynamicValueRight Boundary
abc1def=DynamicValueRight Boundary
abc2def=DynamicValueRight Boundary
-
-
-
-
abc9def=DynamicValueRight Boundary

Solution:
To capture the desired text/string, we can put the following by modifying the correlation function argument with the text flag as **/DIG, where for the above scenario we need to place LB/DIG argument as shown below

web_reg_save_param(“Param_Name”,”LB/DIG= abc#def\=”,”RB=Right Boundary”,LAST);

Note: The dynamic values in boundaries are replaced with # symbol.

Type 2:
If the dynamic values are of below scenario

abc013def=DynamicValueRight Boundary
abc122def=DynamicValueRight Boundary
abc232def=DynamicValueRight Boundary
-
-
-
-
abc906def=DynamicValueRight Boundary

Solution:
In the given scenario there are multiple digits which are randomly changing, so we have to place the # sign for each random digit.

web_reg_save_param(“Param_Name”,”LB/DIG= abc###def\=”,”RB=Right Boundary”,LAST);

Type 3:
If the dynamic boundaries are of below type (Alpha numeric)

abc0c3def=DynamicValueRight Boundary
abc1h2def=DynamicValueRight Boundary
abcn3edef=DynamicValueRight Boundary
-
-
-
-
Abcz46def=DynamicValueRight Boundary

Solution:
In the given scenario the left boundary values are dynamic with different alpha numeric values, so we need to place the sign ^ instead of #, by modifying the correlation function argument as **/ALNUM instead of **/DIG text flag with the desired boundary argument.
web_reg_save_param(“Param_Name”,”LB/DIG= abc^^^def\=”,”RB=Right Boundary”,LAST);

Type 4:
If the boundaries are containing case sensitive nature

Solution:

Whenever there is a nature of case sensitive, we  need to modify the correlation function argument as **/IC/DIG text flag with the desired boundary arguments as below

web_reg_save_param(“Param_Name”,”LB/IC/DIG= abc#def\=”,”RB=Right Boundary”,LAST);


Below is the list of text flags that LoadRunner can support


Argument
Description
/IC
To ignore the case type
/BIN
To specify the binary data
/DIG
To interpret the sign # as a wildcard for a single digit
/ALNUM
To interpret the sign ^ as a wildcard for a single alpha numeric type


Handling dynamic values in LoadRunner


As you all know that to make a recorded script work for multiple users, we need to handle few dynamic values, which varies for user to user. These dynamic values in LoadRunner can be handled using a specific function

web_reg_save_param(const char “Param_Name”, <List of Attributes>, LAST);

The list of attributes that are available for web_reg_save_param() are:

Param_Name: Param_Name is a variable which save the dynamic value that is handled by the function and can also be used for further reference.

LB: LB is the attribute that denotes the left boundary of the dynamic value / required parameter, this should not be a NULL and also it is case sensitive.

RB: RB is the attribute that denotes the right boundary of the dynamic value / required parameter, this should not be a NULL and also it is case sensitive.

NotFound: The handling method when a boundary is not found and NULL string is generated. 
If “NOTFOUND=error”, this is the default value which indicates that an error to be raised when boundary is not found.
If “NOTFOUND=EMPTY/WARNING”, this will not issue any error message and executes the script.

NOTE:
When “Continue on Error” is enable in the runtime settings of the script and even “NOTFOUND=error“ will writes an error message in the Extended Log and script execution will continues.

Ignore Redirections: If "Ignore Redirections=Yes" is specified and the server response is redirection information (HTTP status code 300-303, 307), the response is not searched. Instead, after receiving a redirection response, the GET request is sent to the redirected location and the search is performed on the response from that location.


ORD: This is an optional attribute, need to use according to the requirement. When you specify “ORD=n” (where n can be any occurrence) it save the specified occurrence of the parameter and when you specify “ORD=ALL”, it saves all the parameter values which are occurred thee specified LB and RB in an array. The default value of ORD is 1.

SaveOffset: An optional attribute with default value as 0. This saveoffset value is used to save a sub string of the found value into the parameter

Search: This attribute is used to specify the scope of the search where to find the requested delimiter. The default value is Search=ALL where it search in search body, headers and resources and other possible values are

Search=headers where it searches only in headers,
Search=Body where it searches only body but not the headers
Search=Nonresource searches only the HTML body by excluding the headers and resources

SaveLen: The length of a sub-string of the found value, from the specified offset, to save to the parameter. This attribute is optional. The default is -1, indicating to save to the end of the string.


Mechanism to handle correlation (Dynamic Values)

·        Auto correlation:

This is an amazing inbuilt feature of LoadRunner, where the tool itself will identify the dynamic value and applies the correlation function to the same.

Steps to do auto correlation:

Step 1: Record the required critical business transaction using required record time settings
Step 2: Click on Design Studio tab once after opening the script
Step 3: In a new window list of all the dynamic values will be displayed which can be correlated
Step 4: Select the required correlation function which are needed

Manual Correlation:

Step 1: Create the 2 identical scripts and save those 2 scripts in windows temp directory.
Step 2: Open any one of the script from the script go to Tools menu.
Step 3: Select compare script for the comparisons, the difference between the two scripts will display in the Wdiff utility.
Step 4: Identify the dynamic context charge between two scripts identically the Left & Right boundary of the dynamic values.
Step 5: Write the correlation function with LB, RB and also with the required attributes.
Step 6: Copy the LB of the dynamic value and search in Code Generation log, once after finding the value in the log. Double tap the value and it will prompt the location where the correlation function need to be placed
Step 7: Search for the First occurrence of the dynamic values to replace by a given parameter name.
Step 8: Select the position to insert the correlated function with all the parameters

Performance testing tool comparison

Here I come up with comprehensive solution to provide greater insight into application performance and its overall architecture. By viewing application from multiple perspectives, Total Performance Management helps in collecting all the data to improve the performance of applications and take action to prevent future problems.

Common Tool specific features



Comparison of Performance testing tool features

The below specified comparison was done based on my experience in respective to the tool, this might be changed for upgraded version of the respective tools