Every performance testers must know about how to correlate, no matter which tool they are using. Correlation is nothing but capturing the dynamic data (response) from the server and send the captured response to the subsequent requests.
To capture the dynamic data from the server, in LoadRunner we use web_reg_save_param function. In web_reg_save_param function, we use following parameters: Left boundary, Right boundary, Ord, SaveLen etc.
E.g. consider below is the dynamic data from the server which has the LB and RB as <span class=”login-bold”> and </span> respectively.
[stextbox id=”grey”]<span class=”login-bold”>@oiewhvsj@$39945ksjklsg</span>[/stextbox]
In above case, we can easily capture the dynamic data and pass it to subsequent requests. But what if the left and right boundaries changes dynamically? How to handle dynamic boundaries? In this article, we are going to see about how to correlate dynamic boundaries in LoadRunner.
E.g. consider the below response from the server which has the dynamic boundaries.
[stextbox id=”grey”]
OrderID1234=dynamicresponsedata1234
OrderID3456=dynamicresponsedata3456
OrderID8798=dynamicresponsedata8798
[/stextbox]
The left and right boundaries are OrderID1234, OrderID3456, OrderID8798 and 1234, 3456, and 8798 respectively. The dynamic data is dynamicresponsedata
To capture the dynamicresponsedata by using left and right boundaries (of course that is also dynamic in nature), use below syntax:
[stextbox id=”grey”]
web_reg_save_param(“Correlation_1”, “LB/DIG= OrderID####\=”, “RB=####”, LAST);
[/stextbox]
you need to enter DIG to interpret # (hash) tag where you expect digit. You can use IC flag i.e. ignore case flag in your function as shown below. Apart from IC, DIG, you can also use ALNUM (alpha numeric), to specify binary data, use /BIN
[stextbox id=”grey”]
web_reg_save_param(“Correlation_2”, “LB/IC/DIG= OrderID####\=”, “RB/IC=####”, LAST);
[/stextbox]
If the left and right boundaries has dynamic string e.g. four letter user name, you use below syntax.
OrderIDUsername=dynamicresponsedataUsername
[stextbox id=”grey”]
web_reg_save_param(“Correlation_3”, “LB/IC/DIG= OrderID^^^^\=”, “RB/IC=^^^^”, LAST);
[/stextbox]
what if the left boudary is not constant
ex. abcd123/hyderabad>” here left boudary is= abcd123/ Rb=>”
abcde12345=chennai>” here lb=abcde12345= Nd rb=>”
bcedf123456*mumbai>” here lb=bcedf123456* and rb=>”
could u please tell me how to correlate now
[email protected]
In this case, you can use regular expressions in the web_reg_save_param_ex(); function.
Hi Naveen, I am stuck up with the above scenario, could you please help me with some sample how to use both function as a combination to handle this situation.
Hi Naveen,
How to do correlation, if there is no left boundary.. Please let me know.
Thakns,
Karthik
You can use web_reg_find(); function.
Thanks Naveen.. What would I do , if boundaries like,
lb12ga
lbXYMga
lb1234ga…
Please advice which funtion I should use here, and explain how it works…
Thanks,
Karthik
hi,you can use
web_reg_save_param_regexp();
Hi Naveen,
Have one more doubt here in Jmeter,
i=charts_0/chart_0_2.png&g=93a696c6864046e8bc5dcc36881c80ad is a response from the server.
Where “g=” is left boundary and not able to mark anything here as my right boundary..
Can u assist, how to work without right/left boundary in Jmeter
Hi Karthikkumar R,
You can use the below Regular expression to get the g value alone.
g=(\S+), it will retrieve the value without giving the right boundary. Please
Note : \s is used to for escape from space + is used for get the required value
Hi Naveen,
What if left and right boundaries have special characters and are dynamic values?
You need to use Regular expressions :)
Hi Naveen,
How do i correlate boundaries are dynamic using web_reg_save_param_regex function?
Hi,
I want to correlate the field(RollNo=123456&)
where my LB=RollNo= and what would be my right boundary.
If I give my RB as RB=&, LR is throwing error during run time as No match found for the requested parameter.
Thanks in Advance
Hi Naveen,
How to do correlate a value with out LB and RB? am getting the server response as 32 digit dynamic value, could you please help me /suggest me how to correlate the value??
thanks,
Pruthviraj
Hi Naveen,
How to do correlate a value with out LB and RB? am getting the server response as 32 digit dynamic value, could you please help me /suggest me how to correlate the value??
thanks,
Pruthviraj
From below text, I need the get the value “56767 – Business Apps” How to specify the LB and the RB. LB and RB are in different lines. We cant take LB as”value=” because there are many other data with same value. We have to specify the LB as “name=”billToDept” “. Please Suggest
readOnly=”readOnly” id=”departmentName_0″ name=”billToDept”
value=”56767 – Business Apps” title=”56767 – Business Apps”
Hi Naveen,
I am having dynamic Left and Right boundaries with -*1.1.0.1 and 1.1.0.0.*1
eg on response I am getting
sup=-*1.1.0.1.A7656HJGFYEHW8766H8JJ9889KOIUPy.1.1.0.0.*1
on request supa=-*1.1.0.1
supc=1.1.0.0.*1
value=A7656HJGFYEHW8766H8JJ9889KOIUPy.
how can I correlate value?
how can I correlate value?
Hi
I have correlated one value and this i need to pass in LB of another value then please suggest steps to follow.
Scenario:
My first Correlation name is C_SearchCert1 and need to pass in other LB –
SearchCertDet{ C_SearchCert1}\”>
is this correct way of passing other correlation value into other correlation of LB?
Hi,
Just a question arrived in my mind
I need to capture the value 56 were as the valuye is 123456789
LB is 1234
RB is 789
and my LB and RB is changing everytime
could you please help me on this
Thanks
Ganesh
web_reg_save_param(“Correlation_1”, “LB/DIG= ####”, “RB=###”, LAST);
Suppose I had dynamic length of numbers in left boundary, how to correlate?
eg:
LB=123
LB=1234
LB=12355
pls help….
you can use the reg expressions for the digits.
kindly share the corelation process how to handle dynamic length boundary(with picture).
How to correlate when LB is different for different values
Example – for first data 1 gid value is
– lb is market data and value is 1234 and rb is script
Other gid has lb as record and value and rb as script same goes on….
But for 2nd data 1 gid value is
Having diff lb than first data
Then how can we correlate this?