Correlation is one of the most time-consuming tasks in Performance Testing Life Cycle. Most of the performance test engineers spent most of their effort in correlating requests to get successful responses. We will see how to correlate in LoadRunner by manual and automatic approach.
What is correlation?
Correlation is the process of finding dynamic values (such as session value in the form of JSESSION, VIEW STATE etc.) in the response and passing it to subsequent requests.
For example, if you login into ICICI Bank, you could see there will be a parameter jsessionid={xxxx_some_dynamic_valu_xxxx}
If you replay your script without correlation, VuGen cannot replay, because jsessionid parameter is dynamic, new and unique. If the script sends this parameter to web server; webserver will not accept it, and the subsequent requests will fail.
When correlation parameter is created, VuGen adds a functions usually web_reg_save_param_*, that extracts the dynamic value and then it stores into a parameter.
Types of Correlation
To perform correlation, there are two ways.Â
- Automatic Correlation
- Manual CorrelationÂ
Which values to correlate?
Identifying the values that needs to be correlated comes by experience. If you familiar with the application, you can catch the values to correlate by simple walkthrough of the script. Here I have listed few important values/strings that draw your attention.
- Login String
- Date, Time, Year
- Session ID, View State followed by strings
How to correlate automatically?
Automatic correlation is quite easy. Open the script, navigate to Vuser > Scan script for correlations or press CTRL + F8 key combination as shown below.
Tip: you must run once before you scan for correlation
VUGen will throw below pop-up, click on Yes to scan for correlations.
VuGen starts scanning, once it is completed, values that needs to be correlated will display in the Correlation Results pane as shown below.
To correlate, select the value carefully and then click on Correlate button. When you correlate, VuGen adds below code to your script.
//Correlation comment – Do not change!Original value=’66990684′ Name =’CorrelationParameter_1′
           web_reg_save_param_ex(
                       “ParamName=CorrelationParameter_1”,
                       “LB=109968.0”,
                       “RB=f”,
                       SEARCH_FILTERS,
                       “Scope=Body”,
                       “RequestUrl=*/nav.pl*”,
                       LAST);
Care must be taken while you perform automatic correlation. I don’t prefer automatic correlation, because it might capture the string which is unnecessary and correlate.
We will see how to replace dynamic value with correlation parameter in next post.
Thanks for visiting QAInsights!
We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything.
Subscribe to our QAInsights YouTube Channel. Subscribe our free weekly newsletter or Google feeds
Nice blog and its helpful for me to learn Correlation in understandable way. could you please elaborate and write a blog on More about left Boundary and right boundary In Correlation.
Thanks in advance.
Sure thing :) Thanks :)
Can u please tell me different types of correlation used in load runner …