How to correlate in HP LoadRunner if there are no boundaries?

Correlation is a critical task in performance testing and also time consuming activity. It doesn’t matter which tool you are using; Apache Jmeter or HP LoadRunner consumes additional effort to correlate data. There are two ways of performing correlation in HP LoadRunner: Automatic and Manual correlation. In Jmeter, only manual correlation available at this moment.

What is correlation?

Correlation is nothing but catching the dynamic values that are returned from the server and pass it to the subsequent requests. It is a specific set of activity that would be performed after recording and replaying the script in the tool. Captured values will be saved into a parameter, that parameter will be used in the subsequent requests. So that the business scenario completes without any error.

There are two ways of performing correlation is LoadRunner: Automatic and Manual. I always prefer Manual correlation, though it consumes time. You can refer below articles on how to perform correlations in LoadRunner.

http://qainsights.com/how-to-correlate-in-loadrunner-part-one/

http://qainsights.com/how-to-correlate-in-loadrunner-part-two/

Typically, following parameters gets involved when you perform correlation: Left boundary, Right Boundary, Scope, Ordinal, and Correlation parameter name.

How to correlate in HP LoadRunner if there are no boundaries?

Problem Statement

Assume that you have a scenario that the response from the server is just a string/text/phrase. Still you could parameterize it by going to View > Source and catch the <HTML> tags as left/right boundary. Suppose, if you couldn’t find any tags in the source, how can we correlate? In this article, I am proposing two solutions on how to correlate if there is no source for the response.

Solution 1

E.g. the response from the server is just “Started” (without double quotes). You can have left and right boundary as “S” and “d” respectively. Below is the code snippet where it will get the text using the LB and RB and compare it with the expected server status.

char expectedServerStatus[] = “tarte”;

web_reg_save_param_ex(“actualServerStatus”,
“LB=S“,
“RB=d“,
“Scope=Body“,
“Ord=1“,
LAST);
//your web_custom_request() goes here

if (strcmp(lr_eval_string(“{actualServerStatus}”), expectedServerStatus) == 0)
lr_output_message(“Server has been started”);
else
lr_output_message(“Server is not yet started”);

Solution 2

In this solution, we are not going to use web_reg_save_param_ex(); function. I am going to leverage the web_reg_find(); function with additional parameter.

Below is the typical web_reg_find(); function which will just find the text “Started” and logs the default message in the Output window.

web_reg_find(“Text=Started“, LAST );

Below is the extended web_reg_find(); function which will count the text in the page response.

web_reg_find(“Text=Started“,”SaveCount=Server_Status_Count“, LAST );

if (atoi(lr_eval_string(“{Server_Status_Count}”)) > 0)
lr_output_message(“Server has been started”);
else
lr_output_message(“Server is not yet started”);
 

Correlate without boundaries

5 thoughts on “How to correlate in HP LoadRunner if there are no boundaries?”

  1. Hi Naveen,

    I have installed LR 12.53 in my Lap, am having an issue while correlating the Session ID. I am used (have basic knowledge on LR 9.5 and its working)

    In LR 12.53 after recording the script and replay, the tool is not pooping me up the error to correlate the session ID. I checked all the recording options and unchecked “Automatically correlate values found” option and re-ran the script. Even then there was no error.

    I clicked on Design Studio to check the correlation value. There when I click on details, am not getting the option LB and RB, where am getting option Expression.

    But when I googled this, the screens clearly tells that options Left and Right boundaries option should be available.

    Please let me know if there is any setting that has to be done to get the options.

    Please help me.

    Thanks,
    Chaithanya A J

    Reply
  2. Hi Naveen,

    In my sample i know the value which needs to be correlated but LB and RB are changing.

    Scenario is, i am not passing any value in search. just clicking on the link which is returned from search action. there is a back end code which is generating an associate ID with the main ID and link it example cal it as Service ID so it will generate a servID while submitting the data to the server

    How to use regexp in this case

    Appreciate your early reply as i am chasing a deadline.

    Reply
  3. There’s an integer value which I need to corealate. But it is not having any left and right boundary. In the reponse of the request, just that integer value is reflected which is dynamic and changes on every iteration.

    So, how do I correlate this kind of value.

    Reply
  4. Hello Nakul,

    Try using correlation function like below when there are no left and right boundaries and expected correlation value is integer.

    web_reg_save_param(“CorrelationParameter”,”LB=\n”,”RB=”,LAST);
    Thanks,
    Vikram

    Reply

Leave a Comment

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

Learn Kubernetes and Get Certified in CKAD.SHOW ME HOW
+ +
Share via
Copy link