correlation

What is correlation?

I trust you have followed my earlier posts on this blog to get yourself started on LoadRunner. If not you can find them here

Ok, so now we come to one of the most important topics in LoadRunner — Correlation. I would recommend you to understand each and every aspect around this topic.

If you simply record and playback a script in VuGen, you might encounter errors in your playback. Often, those errors are related to the session values which are sent by the server to the client to identify that particular session.

Why error? Well, session values will change with every playback of the script.

To overcome this we need a way which can capture these dynamically generated session values and pass it subsequently to any part of the script, wherever required. This method to identify and set the dynamic generated value is known as correlation.

If your new to loadtesting, don’t confuse this term with parameter which you might have used in tools like QTP to pass varying values. Parameter is not a dynamic value captured from server response but it is something for which the user has predefined data values available.

LoadRunner use three functions to correlate scripts:

  1. Web_reg_save_param
  2. Web_create_html_param
  3. Web_create_html_param_ex

The last two are just used for backward compatibility. The first function is used often. We will touch upon details of this function in the next post

Related posts:

  1. web_reg_save_param function explained
  2. Advantages of LoadRunner

Discussion

31 Responses to “What is correlation?”

  1. Hi,
    iam Rajesh, can u plz tell me about brief description about correlation concept. Iam getting confused about that topic. Hope u will mail me about correlation.

    Posted by Rajesh | April 22, 2008, 12:32 pm
  2. Correlation is used to capture dynamic values in performance testing. Suppose the values like time and date at same of recording never be same as run time and sometimes or some times when working with web applications “session ids”.
    What we have to do is we have to use some functions whose o/p works as i/p of some other function and finally we get the value of dynamic variable which can have the value as o/p these functions. These o/p values will exactly matches with run time value of dynamic variables and test never fails due to dynamically changing variables.
    This correlation can be done in 2 ways.
    1. first when u r not familiar with data items whom u have to correlate then u can use lr’s search correlation option, lr list all dynamically changing variables of your test and lists then u can choose according to your requirement. It’s called as Auto correlation
    2. Secondly if u r familiar with those whom you have to correlate directly u can correlate it’s called as Manual correlation
    Manual & Automatic Co-relation
    Manual correlation – Correlation is used to obtain data which are unique for each run of the script and which are generated by nested queries.
    Automatic correlation is where we set some rules for correlation. It can be application server specific. Here values are replaced by data, which are created by these rules

    Posted by priya trivedi | June 18, 2008, 3:15 pm
  3. Can we use Web_reg_save_param replace Web_create_html_param or vice versa?
    When to use Web_reg_save_param & when
    Web_create_html_param ? Any specific scenario?

    Posted by Pals | August 4, 2008, 5:29 pm
  4. Understanding correlation is always a problem for novices and in some cases the experienced tester as well. It is really a simple thing. The hard-coded data in your web requests is of two types. 1. The data that you provided when you recorded the script.
    2. Data that you did not provide (such as session identifiers)

    When you look at your web requests, look for the values that you didn’t provide when you recorded the script. These will all be possible candidates for correlation.

    Here are the steps that work to do a manual correlation of a web script. Us this when the automated methods fail:

    · Playback the script at least once with Data Returned From Server and Parameter Substitution turned on in the log section of the scripts run-time settings.

    · Find the hard coded data value in the script that needs to be correlated. There are a number of methods available to locate the values to be correlated. The basic rule is any hard coded data value that was not entered by the user is a candidate for possible correlation.

    · Search in the Generation log for the original hard coded data value that you wish to correlate.

    · When the data value is found, the left and right data boundaries will be exposed. Copy the left and right boundaries and the data value and paste them into an open notepad.

    · Extract just the left data boundary and search the Replay log for this left boundary.

    · When found, verify that a changed data value is displayed adjacent to the search boundary. If so, double click on the line that was found and the cursor will jump to the line in the script that returned the data.

    · From the script menu, select Insert->New Step->Services->web_reg_save_param.

    · The “Save Data to a Parameter” dialog box will be displayed. Complete this dialog box and click OK. This action will affect the capture of the data values; but, it will not complete the correlations. You must also complete the following steps.

    · Substitute the new correlated parameter for the hard coded data value everywhere it is found in your script.

    · Verify Execution and verify that the correct value is captured and substituted in your script.

    Posted by Gary Stewart | August 14, 2008, 8:08 pm
  5. Hi ,

    I have gone through ur artical on correlation.It was quite good.
    Ihave a small suggession …if possible plz explain concepts with an example(screenshots) …it will be helpful.

    Thanks,

    Sudheer

    Posted by Sudheer | August 14, 2008, 11:53 pm
  6. @Gary Stewart: Nice points there.

    @Sudheer: Thanks…well,I am planning to do some videos in future for more clarity.

    Posted by Ankur | August 15, 2008, 12:06 am
  7. Please try to post some vedios or screen shots. I would like to know more about how we make the changes in code etc

    Posted by Purusharth Mahay | September 25, 2008, 10:12 pm
  8. I have seen that all the discussions about the dynamic correlations are related to web application. Can i use this feature in application clients like J2ee Client Application?

    I am confused if for example i record a script where client sends an incremented primary key value to an application server for insertion of a new record inside a DB table. How can such a call be correlated during replay of the above recorded script? Here no dynamic data is sent back by the server.

    Posted by Rashid | October 8, 2008, 6:35 pm
  9. HI,
    I hari.k have exp in manual Testing. i have just finshed course on load runner. could you please
    tell me about correlation. i heard there are two types. how is it used? pls reply my doubt

    Posted by hARI | October 9, 2008, 4:20 pm
  10. How to record and run the application in the load runner please give me the details briefly

    Posted by How to record and run the application in the load runner plse give me the details briefly | October 13, 2008, 10:35 am
  11. How to record and run the application in the load runner please give me with the navigations

    Posted by Suresh | October 13, 2008, 10:38 am
  12. what is vm stat in load runner

    Posted by Suresh | October 13, 2008, 11:28 am
  13. Hi,

    I’m trying to measure page load times in a web app. How do I verify that the page I go to next is fully loaded? Do I use content verification (web_reg_find)? I am measure the time it takes for a page to load and then the user goes to another page and another and so on. I need to know how long it took for page one. How long it took for page two and so one. I’m using transactions for each page, but I want to make SURE that the page is fully resolved/loaded before the scenario goes to the next page. So, does LoadRunner automatically do this or do I have to use content verification or do I do it in some other way?

    Thanks,
    Brian

    Posted by Brian | November 12, 2008, 3:44 am
  14. after writing the fn web_reg_save_param , we get the matching values… now we record 1 functionality in the application nd want to corelate with the other functionalities by substituting a common parameter in place of dynamic values………….. ???? The match takes place but could not locate the dynamic values……error(404) is shown……… plz anybody help me with this…………….

    Posted by ADITYA | November 19, 2008, 11:22 am
  15. This is really vey useful.
    I need more explaination in Laodrunner Analysis Report. How it explain to developer where is the error occurs exactly.
    Please Help me.

    regards
    Shruti

    Posted by Shruti | February 11, 2009, 11:18 am
  16. With the help of LOAD RUNNER ANALYSIS report , If the Performance is
    dipping or down…. sort out the various transactions whose response
    time or throughput,etc is very high than expected….. so tell the
    developer to identify the bottleneck in only those transactions…..
    now, from developer point of view it might be SCALABILITY issue or a
    code tuning problem….

    In short, you can pin point the transaction but node the exact line of
    code……

    Thanks,
    Aditya kumar singh

    Posted by Aditya kumar singh | February 11, 2009, 1:57 pm
  17. have a doubt about correlating the values, i had recorded the to identical script and compares this by using wdiff but cant find any major differences,it just shown the difference like lr_think_time,setcoordinates…so in this condition what values i have to take for correlation.

    Posted by suriya | May 12, 2009, 4:53 pm
  18. Hi Frns, Currently i am working on manual, But i would like to work on Load runner. So can any one of you let me know about load runner briefly to test any application with screen shots. Screen shots are mandetory for me.

    Posted by Shyam | July 7, 2009, 12:35 pm
  19. Please explain the use of correlation in detail.

    Posted by chiku | January 18, 2010, 3:09 pm
  20. Hi,

    I m new to this blog.Cud u plz explain me to manually correlate the date in Loadrunner scripts.I m undergoing training in Loadrunner

    Posted by subashini | April 22, 2010, 10:49 pm
  21. Hi,
    In my current propject i am facing am issue,There is a scenario that where i need to create a helpdesk ticket ,at run time it generates some unquie values,which at run time throwing error saying validating unquie index defined on the form,but there are no whihc unquie values defined actually,is it a correlation issue ,i have tried to record two scripts and compared them there many values generated and they are different for each recording, I have tried correlating helpdesk number still i am getting issue,should i have to correlate all the values which are different for each recording ? Please let me know ASAP,Waiting for reply,

    Thanks,
    Parveen

    Posted by Parveen Shaik | May 12, 2010, 9:41 am
  22. I am also new to this blog, as well as to LoadRunner. We have a big project coming up and I want to see if manual correlation is something that will help us. Could someone please explain how it works and provide screenshots if possible? Thanks very much.

    Posted by Doug | May 14, 2010, 7:29 pm
  23. Hi ,
    This is srinivas working as amanual tester .now i want to learn loadrunner………pls guide me how to learn loadrunner

    Posted by srinivas | August 23, 2010, 2:16 pm
  24. i have to test 3 scenario through 1 script for example:- through my application you can book air ticket,Train ticket and bus ticket.can i give 30% uaers load on air ticket ,30% uaers load on train ticket and 40% uaers load on bus ticket through 1 loadrunner script.

    Posted by Rakesh Ranjan Kumar | February 22, 2011, 2:10 pm
  25. i am doing correlation manually during run left boundary value also changing some time how i handle this things

    Please revert ASAP

    Posted by Rakesh Ranjan Kumar | February 22, 2011, 2:14 pm
  26. Hi All,

    Need your inputs on below issue:

    User interface: BOXI 3.1 Infoview opendoc.

    Phase: Performance testing
    Tool: HP Load Runner 9.1. (LR)
    Issue in parameter: Correlation

    We need to perform PT for 120 users as part of project requirement. As there are many web links that are traversed while browsing report in Infoview (login, prompt, default view, drill etc) we have used automated correlation so LR can keep track of changing session ID.

    LR script is working fine with 25-35 users and beyond that it starts throwing an error “Error -26377: No match found for the requested parameter “WCS_param6″. Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1024 bytes, use web_set_max_html_param_len to increase the parameter size”

    Additional inputs may be helpful to analyze

    1. Without use of correlation the response time of transactions is too very low (.001sec) and is not realistic.
    2. web_set_max_html_param_len is already increased to 262144 bytes. (gives same error again on increasing the number of users).
    3. Due to many traversal of links (in between there are many blank pages) we are unable to view the report execution in Run Time Viewer of Load Runner.

    Please share inputs from your experience of load runner with BO Infoview reports. Also if you have any reference to MANUAL CORRELATION please let us know.

    Any pointers for resolving the issue will be highly appreciated.

    Thanks,
    Ankit

    Posted by Ankit | May 30, 2011, 6:02 pm
  27. My question is , if not find the seesion ID in tree tab, then hw we can do the correlation please give me the answer ………

    Posted by Naveen | July 5, 2011, 10:40 am
  28. can u tell me why dynamic value generated while scripting

    Posted by gowthami | December 7, 2011, 4:06 pm
  29. Correlation = The process of enhancing a VuGen script to process dynamic data passed between client and server.

    ** Dynamic value are hardcorded in the generated script.**

    Step 1 (in Vugen script) Login
    Client login with username/pwd TO SERVER

    Server= Authenticate, provide sessionid@234567

    Step 2 (in Vugen Script) Client request info @234567
    SERVER= Provide info with correct sessionid .
    ( this is while recording a vugen script)
    ———————————————————–
    Replay fails due to hardcoded value ………
    Step 1 (in Vugen script) Login
    Client login with username/pwd TO SERVER

    Server= Authenticate, provide sessionid@678230(this is a new sessionid )

    Step 2 (in Vugen Script) Client request info @234567
    Client request info sessionid @234567

    SERVER = failing request due to sessionid mismatch….
    Vugen script replay fails.
    ——————————————————–
    Dynamic Value Correlation= Capture and reuse new dynamic value during script replay.
    example=== Capture the value @234567 and save to placeholder {abc}.
    Replace hardcoded value @234567 with placeholder{abc}
    ———————————————————
    Web_reg_save_param_ex ()(“Session_ID” ,”LB=Sessionid=” ,”RB=\”",”Ord=1″,Last);
    ——————————————————–

    Posted by Archana | January 18, 2012, 10:21 am

Trackbacks/Pingbacks

  1. [...] explained in one of my previous posts, web_reg_save_param is THE most important function when you are working with LoadRunner. We will [...]

  2. [...] the point1) above you can guess, HTML mode would have less correlation to do while URL mode has much more complex correlation [...]

Post a comment

Archives

Grab My Banner

Learn LoadRunner