How to do correlation when the boundaries are dynamically changing?

Loadrunner
Consider a scenario when the Left and Right Boundaries are dynamically changing, using which we will have to capture the correlation value.

1. If the LB and RB has dynamically changing numbers:

Then your LB and RB becomes LB/DIG & RB/DIG and replace the dynamically changing numbers in the boundary with #.

Example:

Iteration 1: City001"Chennai"001City
Iteration 2: City002"Bangalore"002City
Iteration 3: City003"Delhi"003City

Here we can see that LB and RB are getting incremented from 001 to 003. So, our boundary becomes

LB/DIG = City00#\"
RB/DIG = \"00#City

2. If the LB and RB has dynamically changing alphanumeric values:

Then your LB and RB becomes LB/ALNUM & RB/ALNUM and replace the dynamically changing alphanumeric values in the boundary with ^.

Example:

Iteration 1: Citya01"Chennai"a01City
Iteration 2: Cityb02"Bangalore"b02City
Iteration 3: Cityc03"Delhi"c03City

Here we can see that LB and RB are getting incremented from a01 to c03. So, our boundary becomes

LB/ALNUM = City^^^\"
RB/ALNUM = \"^^^City



SaveOffset attribute in web_reg_save_param

Loadrunner
SaveOffstet:

SaveOffset attribute defines how many places after the Left Boundary, dynamic value should be captured.

Example:

radiobutton1="Chennai"

Dynamic value to be captured is Chennai

web_reg_save_param("City",
"LB=radiobutton",
"RB=\"",
"SaveOffset=3",
LAST);

Result:

City = Chennai

Here, the LB is radiobutton and we have mentioned the SaveOffset as 3 . So it will capture Chennai leaving 1=" (3 places after the LB) and save it in the Correlation Parameter City.

Standard deviation and its importance in performance testing

What is Standard Deviation?

Mathematical Definition : It is the measure of how spread out the numbers are around the mean.
Performance Definition : It is the measure of how response time is spread out around the mean.

It is denoted by Sigma (σ).


Formula: 

square root of [ (1/N) times Sigma i=1 to N of (xi - mu)^2 ]

Where

N = Count of the response time
x = Individual response time value
μ = Mean or Average response time

Importance of Standard Deviation in Performance Testing

  • Standard Deviation tells whether a transaction is consistent throughout the test or not.
  • A small standard deviation means that the response time of all the iterations of the same transaction are close to each other. 
  • So smaller the value more close the transaction response times are and more consistent the transaction is.
Example:


Lets calculate the Std. Deviation for the above transactions.

Login Transaction:

Step 1 - Average Response Time or Mean value =  5
Step 2 - 
(5-5)²  = 0
(5-5)²  = 0
(6-5)²  = 1
(5-5)²  = 0
(4-5)²  = 1
Step 3 - (0+0+1+0+1)/5 = 0.4
Step 4  - √ 0.4 = 0.632

Inference :
In the Login transaction we can observe that response time of each iteration are close enough so the Std. Deviation is small. It means Login transaction is more consistent throughout the test.

Logout Transaction:

Step 1 - Average Response Time or Mean value =  5
Step 2 - 
(5-5)²  = 0
(4-5)²  = 1
(12-5)²  = 49
(3-5)²  = 4
(1-5)²  = 16
Step 3 - (0+1+49+4+16)/5 = 14
Step 4  - √ 14 = 3.741

Inference :

In the Logout transaction we can observe that response time of each iteration are having large deviations so the Std. Deviation is high. It means Logout transaction is less consistent throughout the test.

Cache and its impact on performance testing

What is Cache?

Cache is a temporary storage area where an applications non html resources are downloaded and stored when the user access the application for the first time. When the user again access the application, the request will not be sent to the server instead all the resources will be downloaded from the cache memory, making the user feel a faster page loading experience.

How does Cache impact performance testing?

Caching has a negative impact on the performance testing. When caching is enabled during the performance test the request will not be sent to the server and the resources will be downloaded from the cache memory thus showing an improved response time, providing improper test results. So cache has to be disabled during the performance tests.

Different Cache settings in loadrunner: (Run-time Settings --> Browser Emulation--> Browser Cache)

Simulate browser cache  - This option instructs the loadrunner to download the resources from the cache and it will not ask the server for the resources.

Simulate a new user on each iteration - This option instructs loadrunner to simulate a new user on each iteration and so a new cache. When this option is not selected same cache will be used for all the iterations.

With Simulate browser cache and Simulate a new user on each iteration - Loadrunner will use the same resources in the cache for each iteration but will load them only once per iteration.

With Simulate browser cache and without Simulate a new user on each iteration - Loadrunner will download the resources and save them in the cache during the first iteration and the same cache will be used from the second iteration.

web_cache_cleanup

  • web_cache_cleanup loadrunner function can be used in the script to clear the cache which is similar to the Simulate a new user on each iteration.
  • When web_cache_cleanup is used in the script, it will override all the cache Run-time settings.

Significance of 90 Percentile response time in performance testing

Loadrunner
We all would have seen the 90 percentile response time in our analysis summary report and this percentile value can be customized according to our NFR's. In this post we will take close look at what this 90 percentile response time is and its significance in performance testing.

What is 90 Percentile response time?

It is the value for which 90% of data points are smaller (or) The permissible response time within which 90% percentage of the users fall.

Here data points refer to the transaction response time.

Lets take an example to understand this.

Consider 10 instance of Login transaction with values 2,1,5,8,3,7,10,9,4,6 in seconds

  1. Sort the Response Time values in descending order 1,2,3,4,5,6,7,8,9,10 seconds respectively.
  2. Remove the top 10% of the Response Time values. Here the top 10% is 10 seconds. So remove it.
  3. Now the higher value left if the 90 percentile Response time. So 9 seconds is our 90 percentile Response time for Login transaction.

Significance of 90 Percentile response time:

Consider you have the NFR's for 90 percentile response time as 9 seconds and from our above example 90 percentile response time is also 9 seconds, which means our NFR is met.

  • It means that 90% of the transactions or users are within the permissible limit of the 90 percentile NFR value.
  • It is more accurate and dependable than the Average response time or some times called as 50 percentile value because average response time means that only 50% of the transactions or users are within the permissible limit of the Average response time NFR. 
  • The average response time will always be less than the 90 percentile response time. Using the below formula find out the 90 percentile to Average response time ratio.

(90 Percentile RT - Average RT) /  Average RT
  • If the ratio is small it means that 90 Percentile RT & Average RT are close enough and the application is having good and stabilized performance.
  • If the ratio is high it means that applications performance is poor.




Reducing the vugen scripts folder size by deleting the unwanted replay files

Loadrunner
If we are using Performance center for performance test execution, then we will be creating a test scenario using zipped vugen scripts which will hold only the runtime files. But this is not the case when we create a scenario using standalone controller. We will have to delete the files that are created during the script replay to reduce the folder size.

Every scenario will have number of scripts and deleting the replay files manually from each scripts folder is time consuming. Hence this has been automated using command prompt (.cmd) file.

Using Command prompt:

Place the Delete.cmd file in the folder where all the vugen scripts are saved and execute it. This will delete the replay files from all the vugen script folders in one go.

Below are the list of files that will be deleted from the vugen scripts folders.

*.idx
mdrv*.log
mdrv.txt
options.txt
*.ci
combined_*.c
output.txt
debug.inf
*.bak
\result1

Note : Make sure none of the vugen's scripts whose replay files are being deleted is open while running the Delete.cmd file.

Download the Delete.cmd file here


How to validate file download scenarios in loadrunner?

Loadrunner
Scenario:

Lets say we have a script in which we need to do file download operation and we need to find out time taken for a file download and based on the file download operation we need to validate the transaction.

Solution:

web_get_int_property - This function provides specific information about the previous HTTP Request.

1. This can be done using web_get_int_property loadrunner function.
2. Place the web_get_int_property  function below the file download web_request.
3. Time taken to download the file can be obtained using HTTP_INFO_DOWNLOAD_TIME attribute of web_get_int_property.
4. Size of the downloaded file can be obtained using HTTP_INFO_DOWNLOAD_SIZE attribute of web_get_int_property.

Sample code below:

long fsize;
int ftime;

lr_start_transaction("File_Download");

web_url("File download HTTP Request");

ftime = web_get_int_property (HTTP_INFO_DOWNLOAD_TIME);

lr_output_message("File download time : %d", ftime);

fsize = web_get_int_property (HTTP_INFO_DOWNLOAD_SIZE);

if (fsize == 0)
{
lr_end_transaction("File_Download", LR_FAIL);
}
else
{
lr_end_transaction("File_Download", LR_PASS);
}