Blog

Correlation in LoadRunner!

loadrunner banner

Correlation is the fundamental concept and the first challenge faced by the performance testers while scripting the business processes for load testing. Correlation is used to capture the dynamic values returned by the server. If you as a performance tester are not being able to capture these changing values on each request then it means that either your script is throwing errors while playing back or it is not effective at all as you would not observe changes in the database and the Application Under Test [AUT]. Many organizations are not capable of carrying out appropriate correlation they must indulge in performance testing services from a reputable and trustworthy third party, as its an important task when it comes to testing software performance. 

It is good practice to mark small functions as transactions to see how well this part of functionality performed under heavy load. A poorly correlated script can deceive the beginners by showing the transaction is passed while playback but it may not be correct.

The best way to check your script that is appropriately correlated is to run the script with parameterized values for 5 to 10 times through VuGen and check if the database and AUT exhibit the changes made by the script, e.g. the records are inserted in the database and lists are populated in the AUT.

CORRELATION OF GMAIL SCRIPT

For the interest of beginners, I would tell you how you can correlate a login script for www.gmail.com. ; So first you need to record a script from VuGen. I have copied a part of the script where correlation is required.

You can see the two parameters dsh and GALX in your recorded script; these two values are changed whenever you would try to playback and if these two values are not correlated then the script would throw an error. You can correlate these two values either by manual correlation or automatic correlation.

AUTOMATIC CORRELATION

Please follow the below-mentioned steps to implement automatic correlation in VuGen.

Go running Time settings

Select the Log option

Select extended log option and check all its options (Parameter substitution, Data returned by the server and advanced trace)

Save new settings and Run the script

Click on the option “scan script for correlation” to find out which parameters need to be correlated

Select parameters one by one and correlate them by clicking on “Correlate” button

Classification of Automatic Correlation

Automatic correlation can be classified or categorized into three forms;

  • Auto-Detect Correlation

Detects and correlates dynamic data of application servers supported by HP LoadRunner.

  • Rule-Based Correlation

It is used when working with a non-supported application server for which the context is known.

  • Correlating All Statements

Helps blindly correlate all dynamic data.

MANUAL CORRELATION

Manual correlation is always preferred over automatic correlation due to the accuracy of this method. Following is the process to manually correlate dynamic values in VuGen,

Open the script in the tree view

Click on the HTTP view option where you will see the URL: www.gmail.com is highlighted if you have clicked on dsh and GALX parameter before navigating to the tree view.

Search these two parameters in the server’s response and correlate them.

PARAMETERIZATION

Once the dynamic values are correlated; you need to parameterize your test for the user name and password for the Gmail login. To ensure your scripts are working you can enable the run time viewer while playback as it would confirm your login with parameterized users. 

In addition to parameterizing login credentials, it’s essential to consider other dynamic data returned by the server for different users. To efficiently identify and handle such data variations, it’s recommended to create multiple scripts with different user credentials while keeping the input and steps consistent. By employing tools like WDiff or any text comparison tool, you can compare these scripts to detect any discrepancies or inconsistencies in server responses across different user scenarios.

Conclusion

The association is performed not only for the dynamic value of each change but also for the data returned by the server for different users. To identify such data records, use two scripts with different users (login credentials) to keep user input and steps the same. Use WDiff or any text comparison tool to compare these scripts.

Conducting thorough data comparison between scripts with different user credentials allows for comprehensive validation of server responses across various user scenarios. Utilizing tools like WDiff or similar text comparison utilities enables precise identification of data variations and discrepancies, ensuring robust testing coverage across diverse user interactions.