How to correlate dynamic boundaries in LoadRunner?

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”>@[email protected]$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]

Once a week we send a digest with the most popular articles.

About NaveenKumar Namachivayam

Hi there! is a passionate and experienced Performance Test Analyst based in Chicago, IL, USA with the skill sets in Manual Testing, Test Automation, Performance Testing, and Web Services. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs: NaveenKumarN.in, PerfTractor and Giftt

14 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.