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

3 comments:

  1. Hello Rahul,
    The Article on Handling dynamic values in LoadRunner gives detailed information about it. Thanks for Sharing the information about the Hadling the Dynamic Value in LoadRunner For More information check the detail on the Loadrunner testing here Software Testing Company

    ReplyDelete
  2. If you're in search of the best Manual Testing Institute in Noida, APTRON Solutions Noida is your go-to destination. With industry-expert instructors, a comprehensive curriculum, top-notch facilities, hands-on training, placement assistance, and flexible learning options, we are committed to helping you launch a successful career in manual testing. Join us today and embark on a journey towards excellence in the IT industry. Your future in manual testing starts here at APTRON Solutions Noida!

    ReplyDelete
  3. Embarking on a transformative journey in the realm of digital marketing is now within reach with APTRON's exceptional Digital Marketing Training Course in Gurgaon. Nestled in the heart of the city, APTRON emerges as a beacon for aspiring digital marketers, offering a comprehensive curriculum that transcends conventional boundaries.

    ReplyDelete