Thursday, 3 April 2014

What is correlation ?

What is correlation? Difference between automatic correlation and manual correlation?
Correlation :   It’s a Concept to Capture the dynamic values Which are generated from ServerSide.   
                                                          ( OR )
The values that are generated by the server/application at the run time and are used by the application to process the requests are correlated,we capture these values at run time and used them in the script.

Example –        Session ID, transaction id etc, these values are always generated by the server at run time. If we knew them before hand, we could have parameterised them in the script but as these are generated by an algorithm/random number at the run time, they have to be handled at run time only.
LoadRunner provides a function to capture these values, either you do manually or auto correlate, same function is used i.e. web_reg_save_param().

Correlation is 2-types There are 1) Auto Correlation  &  2) Manual Correlation

Auto Correlation
Loadrunner handles the process to capture the dynamic value in each run of script execution.  
If Auto Correlation is enabled, LoadRunner identifies the values that are generated at run time and correlate them. In this method all the handling will be done by Loadrunner itself, leaving almost no control for the user (if required). Also it correlates a lot other values that are not required to be correlated.
We’ve 2-ways of achieving Automatic Correlation.
a.       Enabled Correlation during recording.
b.      Scan for Correlation.
a. Enabled Correlation during recording :
·         Built in Correlation.
·         User Define Correlation
        Loadrunner maintains set of predefined rules called AutoCorrelation Library. If the dynamic values found among these rules,Loadrunner automatically inserts the  web-reg-save-param("Parameter Name”,”LB”,”RB”,LAST); in the script pane.
               1. Select  “Enabled Correlation during recording” . We can enable or disable a specific rule by selecting or clearing the Check box adjacent to the rule.
               2. Click on the new rule, we’ll pas LB, RB and Parameter name.
               3. We can also specify where to look for the dynamic value such as Header, Body, etc.
           web-reg-save-param();  will be written in the script wherever the dynamic value occurs within specified boundaries.
Scan for Correlation :Once you record the script, you’ve to replay the script than we need to use the “Scan for Correlation
Once you reply the script, Replay Log will be created.
When we do scan for Correlation the Vugen will compare the Recording Log with Replay Log and highlight the differences b/w them.
 We click on the correlation button on the right side of the log window to correlate the differences.
Automatic correlation cannot ensure that we’ve captured all the dynamic values (especially when may miss user specific data ). This is the main reason we cannot depend on Automatic Correlation.

Manual Correlation
          To ensure the Script is fully Correlated, we need to go for Mannual Correalion.
In the manual correlation, we’ve to identify the dynamic data that is generated by the server and correlate them by using function  web-reg-save-param("Parameter Name”,”LB”,”RB”,LAST);
We can identify the dynamic values by recording the script in 3-times.
                   1. Recording with user1 (business flow)
                   2. Recording with user2 (same as above)
                   3. Recording with user3 ( same step as above but different i/p values).
Compare the script …………..
 We can run the script after recording. Check the point of failure and if we find any value which is generated during run time. If we find any then we will check for the same step in Tree view. Select the step where the value has been generated. Go to Server response tab and search for that value.Now select the left and right boundaries for that value..Meaning some text from immediate left side and some from immediate right side.

Example:1 –  part_the-value;sessionid=543218;newvalue;
Here left boundary = part_the-value;sessionid=Right boundary = ;newvalue; So any value between these boundaries will be captured.

Example: 2  
web_reg_save_param(”SessionID”, “LB part_the-value;sessionid=”, “RB=;newvalue;”,LAST);
Now replace the value on the script with the parameter {SessionID}
This way we will have more control over the correlation.


No comments:

Post a Comment