Correlation in Performance Testing

Only available on StudyMode
  • Download(s) : 202
  • Published : December 3, 2010
Open Document
Text Preview
·         S/W Environment: Minimum one Web Browser should be installed before PC installation, Use IE 5.5 or higher, Go to Tools > Internet Options > Security tab and click on Custom Level button and make sure that under the Scripting section the Active Scripting is set to “Enable”. ·         Application Type:

·         Project Type:
Target readers: Performance Testers
Keywords: Correlation, Performance

While creating vuser script some data of object will be taken in to the script and few data values has to be generated by the application during time. User can not exit or pass any parameter to it. So we can write some programs which takes this value and output some other values again we pass it to other function like that we can get final output as the value which can be at the time of running the application. This document quotes the main two types of correlations and the different methods to capture them in Load Runner. This document will prove very helpful to any newbie to Load Runner. Example from a real practice:

A Load Runner script for a web server was recorded, which contained two special fields - timestamp and checksum:

    "Referer=http://eprumossd0010:8400/RMS/html/testFramework.html",     "Snapshot=t4.inf",
    "Name=TIMESTAMP", "Value=1192177661211", ENDITEM,
    "Name=CHECKSUM", "Value=715E19300D670ED77773BBF066DAAAE2866484B8",     LAST);

The scheme of this interaction is the following is depicted in the following diagram:


Every time a client web browser connects to web server, server gets current time stamp, calculates checksum and sends them to client. These two fields are used to identify a current session. In other words, the pair of timestamp + checksum is analog of session ID.

Where is the problem? Let's replay the recorded LR script.

The problem occurs when I try to execute my recorded script. Web server checks its current time with a time stamp, sent by client. If client's data is out-of-date or incorrect, then server returns an error:

The parameter "CHECKSUM" is not found or has invalid value.

There is the scheme for this interaction:

Client cannot re-use old (i.e. hard-coded) values for times tamp and checksum. It must request new data. So, instead of hard-coded values, LR script should process dynamic data, returned from server. This can be done using a correlation:

The definition of correlation is:
✓ Correlation is the capturing of dynamic values passed from the server to the client.

Correlation can be done with 2 ways:
1. Automatically
2. Manually
Automatic correlations in most cases do not work correctly. Manual correlation is an accurate method though.

The algorithm of manual correlation is the following:
1. Find a dynamic value to capture.
2. Find server's response, containing the dynamic value.
3. Capture the dynamic value.
Special parameter will be used instead of dynamic value. 4. Replace every occurrence of dynamic value in script with the parameter. 5. Check changes.
Now, l will describe each step in details:
1. Find a dynamic value to capture
Always try to record and save two equal VuGen scripts. After that, open menu item "Tools / Compare with Scripts..." and you can compare both recorded scripts in WDiff: [pic]

2. The differences are highlighted by yellow. This highlighting means that lines (parameters values) change from run to run. So, most probably, these values should be correlated.

Tips: Sometimes, comparing of two scripts cannot detect dynamic values. Imagine, that you recorded this script:     "Name=SessionID", "Value=A38E9002A41", ENDITEM,     "Name=CurrentMonthID", "Value=4", ENDITEM,

It's obvious, that SessionID should be correlated....
tracking img