What is correlation?

Sponsored Links

Filed under: correlation 

If you're new here, you may want to subscribe to my RSS feed or email. Thanks for visiting!

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

Comments

21 Comments on What is correlation?

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

  1. Rajesh on Tue, 22nd Apr 2008 12:32 pm
  2. 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.

  3. priya trivedi on Wed, 18th Jun 2008 3:15 pm
  4. 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

  5. Pals on Mon, 4th Aug 2008 5:29 pm
  6. 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?

  7. Gary Stewart on Thu, 14th Aug 2008 8:08 pm
  8. 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.

  9. Sudheer on Thu, 14th Aug 2008 11:53 pm
  10. 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

  11. Ankur on Fri, 15th Aug 2008 12:06 am
  12. @Gary Stewart: Nice points there.

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

  13. Purusharth Mahay on Thu, 25th Sep 2008 10:12 pm
  14. Please try to post some vedios or screen shots. I would like to know more about how we make the changes in code etc

  15. Rashid on Wed, 8th Oct 2008 6:35 pm
  16. 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.

  17. hARI on Thu, 9th Oct 2008 4:20 pm
  18. 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

  19. URL vs HTML recording mode | Load Runner on Thu, 9th Oct 2008 11:15 pm
  20. [...] the point1) above you can guess, HTML mode would have less correlation to do while URL mode has much more complex correlation [...]

  21. How to record and run the application in the load runner plse give me the details briefly on Mon, 13th Oct 2008 10:35 am
  22. How to record and run the application in the load runner please give me the details briefly

  23. Suresh on Mon, 13th Oct 2008 10:38 am
  24. How to record and run the application in the load runner please give me with the navigations

  25. Suresh on Mon, 13th Oct 2008 11:28 am
  26. what is vm stat in load runner

  27. Brian on Wed, 12th Nov 2008 3:44 am
  28. 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

  29. ADITYA on Wed, 19th Nov 2008 11:22 am
  30. 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…………….

  31. Shruti on Wed, 11th Feb 2009 11:18 am
  32. 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

  33. Aditya kumar singh on Wed, 11th Feb 2009 1:57 pm
  34. 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

  35. suriya on Tue, 12th May 2009 4:53 pm
  36. 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.

  37. Shyam on Tue, 7th Jul 2009 12:35 pm
  38. 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.

  39. chiku on Mon, 18th Jan 2010 3:09 pm
  40. Please explain the use of correlation in detail.

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!





  • Subscribe to this blog

    Enter your email address:

    Delivered by FeedBurner