When we talk about LoadRunner, we generally hear the term Correlation
(which is nothing but capturing dynamic data from the server response
to be used as input in further requests). LoadRunner is good at
auto-correlation capabilities, but sometimes we come across situations,
where only your scripting capabilities and the correct use of some
advanced features can help.
What is Correlation: It is a Process to handle dynamic values in our Script. Here the dynamic value is replaced by a variable which we assign or capture from the server response.
Ways to do correlation: There are two ways to do this Correlation.
They are as follows:
Objective:We generally talk about dynamic data, but what if the strings by which that dynamic data is bound, are themselves dynamic. To put it simply, what if the left and right boundaries of the string to be captured are dynamic?we wanted to capture and handle Dynamic Values when even the Left and right Boundaries are also 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 string handling functions, we get the desired substring out of the captured string.
The Solution can be much simple, Instead of determining the boundaries to the String we can actually use Text flags.
Before Getting into the Topic we should know about the Text Flags:
Text flags are the Flag used just after the text with Forward Slash.
Some of the commonly known and used Text flags are:
Suppose the response data is the string literal, but the issue is that the left boundary is changing every time; you get the left boundary as axb, where x ranges between 0 and 9, as follows:
a0b=Boundaryrb
a1b=Boundaryrb
a2b=Boundaryrb
——–
——–
a9b=Boundaryrb
We can capture the desired string by putting the following correlation function in place, using the /DIG text flag in combination with Left Boundary:
web_reg_save_param (“Corr_Param”, “LB/DIG=a#b\=”, “RB=rb”, LAST);
The corresponding place, which you expect to be dynamically filled in with a digit, should be replaced by a pound sign (#).
Case 2: Boundary is String and if letters are changing case nothing but case sensitive.
web_reg_save_param (“Corr_Param”, “LB/IC/DIG=a#b\=”, “RB/IC=rb”, LAST);
Case 3: Extending the argument further, if there are multiple digits, you have to put a pound sign (#) sing for each digit:
A0123b=”Captured”rb
web_reg_save_param(“Corr_Param”, “LB/IC/DIG=a####b\=”, “RB/IC=rb”, LAST);
Case 4:A Place to be filled either by a Digit or a letter
Till now we were discussing about dynamic digits. If you find a case, where you expect a place to be filled in dynamically by a digit or a letter, then modify the function to use /ALNUM instead of /DIG text flag, and use caret sign(^) instead of # :
web_reg_save_param (“Corr_Param”, “LB/ALNUM=a^b\=”, “RB/IC=rb”, LAST);
To deal with the case while, matching alphanumeric dynamic boundaries, there are three versions of /ALNUM flag as – ALNUMIC to ignore case, ALNUMLC to match only lower case, and ALNUMUC to match only upper case. In the above example, ALNUMIC has been used.
So, go back experiment! But while you do that, keep in mind two things:
1.One sign (# or ^) for each place
2.If you have a literal # or ^ sign, it will not be interpreted as a literal, if you use the corresponding flags. E.g. LB/DIG=a#b will not match “a#b”.
What is Correlation: It is a Process to handle dynamic values in our Script. Here the dynamic value is replaced by a variable which we assign or capture from the server response.
Ways to do correlation: There are two ways to do this Correlation.
They are as follows:
- Auto-Correlation: The Correlation Engine in LR Package captures the value and replaces it with another value.
- Manual Correlation: Understanding of the Script and its response is highly needed to do this. It is bit complex to do Manual Correlation sometimes but this is always the preferred method to handle Dynamic Values in our Script
Objective:We generally talk about dynamic data, but what if the strings by which that dynamic data is bound, are themselves dynamic. To put it simply, what if the left and right boundaries of the string to be captured are dynamic?we wanted to capture and handle Dynamic Values when even the Left and right Boundaries are also 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 string handling functions, we get the desired substring out of the captured string.
The Solution can be much simple, Instead of determining the boundaries to the String we can actually use Text flags.
Before Getting into the Topic we should know about the Text Flags:
Text flags are the Flag used just after the text with Forward Slash.
Some of the commonly known and used Text flags are:
- /IC to ignore the case
- /BIN to specify binary data
- /DIG to interpret the pound sign (#) as a wildcard for a single digit
- /ALNUM<case> to interpret the caret sign (^) as a wildcard for a single US–ASCII alphanumeric character
Suppose the response data is the string literal, but the issue is that the left boundary is changing every time; you get the left boundary as axb, where x ranges between 0 and 9, as follows:
a0b=Boundaryrb
a1b=Boundaryrb
a2b=Boundaryrb
——–
——–
a9b=Boundaryrb
We can capture the desired string by putting the following correlation function in place, using the /DIG text flag in combination with Left Boundary:
web_reg_save_param (“Corr_Param”, “LB/DIG=a#b\=”, “RB=rb”, LAST);
The corresponding place, which you expect to be dynamically filled in with a digit, should be replaced by a pound sign (#).
Case 2: Boundary is String and if letters are changing case nothing but case sensitive.
web_reg_save_param (“Corr_Param”, “LB/IC/DIG=a#b\=”, “RB/IC=rb”, LAST);
Case 3: Extending the argument further, if there are multiple digits, you have to put a pound sign (#) sing for each digit:
A0123b=”Captured”rb
web_reg_save_param(“Corr_Param”, “LB/IC/DIG=a####b\=”, “RB/IC=rb”, LAST);
Case 4:A Place to be filled either by a Digit or a letter
Till now we were discussing about dynamic digits. If you find a case, where you expect a place to be filled in dynamically by a digit or a letter, then modify the function to use /ALNUM instead of /DIG text flag, and use caret sign(^) instead of # :
web_reg_save_param (“Corr_Param”, “LB/ALNUM=a^b\=”, “RB/IC=rb”, LAST);
To deal with the case while, matching alphanumeric dynamic boundaries, there are three versions of /ALNUM flag as – ALNUMIC to ignore case, ALNUMLC to match only lower case, and ALNUMUC to match only upper case. In the above example, ALNUMIC has been used.
So, go back experiment! But while you do that, keep in mind two things:
1.One sign (# or ^) for each place
2.If you have a literal # or ^ sign, it will not be interpreted as a literal, if you use the corresponding flags. E.g. LB/DIG=a#b will not match “a#b”.
Complete Reference On Loadrunner Contact For Training - +91-8050148265: Flag System >>>>> Download Now
ReplyDelete>>>>> Download Full
Complete Reference On Loadrunner Contact For Training - +91-8050148265: Flag System >>>>> Download LINK
>>>>> Download Now
Complete Reference On Loadrunner Contact For Training - +91-8050148265: Flag System >>>>> Download Full
>>>>> Download LINK xU