You are on page 1of 9

Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

LR TIPS & TRICKS

Infosys Technologies Limited


Bangalore, India

Document: Recovering LRR files in Load Runner Ver. Rev: 1.00


Created By: Aswin Suresh .S Signature June 2009
/Date

The information contained herein is proprietary to FMR LLC and shall1not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Author: Aswin Suresh .S

Date: 06/01/2009

Declaration:
I hereby declare that this document is based on my personal experiences and / or
experiences of my project members. To the best of our knowledge, this document
does not contain any material that infringes the copyrights of any other individual or
organization including the customers of Infosys.

Project: FDLERLPT.

Target readers:
Test Engineers, Developers, Project Leaders and Business Managers.

Keywords:
LR Tips,Load runner – Analysis.

Introduction:
This document is created for providing an advanced solution on
LoadRunner tool to the performance testing teams within our firm.

The information contained herein is proprietary to FMR LLC and shall2not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Modification Log

Ver. Modification Authors Remarks Reviewed By


Date
1.0 06/01/2009 Aswin Suresh. S Initial Draft

The information contained herein is proprietary to FMR LLC and shall3not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Table of Contents

LR TIPS & TRICKS.......................................................1


Introduction:........................................................................................5
LoadRunner:........................................................................................5
LR Best Practices:...............................................................................6

The information contained herein is proprietary to FMR LLC and shall4not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Introduction:
This document is used to provide an advanced solution on LoadRunner tool to
the performance testing teams within our organization. This will explain the “TIPS
& Tricks” in LoadRunner.

LoadRunner:
LoadRunner is a Mercury Interactive tool, which helps us to test the
application’s performance. This is user friendly tool, which has four components.

They are,

 Virtual User Generator


 Controller
 Load Generators
 Analysis

Virtual User Generator:


This is used to create scripts. The Script is nothing but recording the application
work flow as per the requirements.

Controller:
This is used to execute different types of tests in different schedule.

Load Generators:
Load Generators are used to provide the load to the Virtual Users. Sometimes
the machine in which the LoadRunner is installed will act as Load generator. It’s a
default Load generator used by LoadRunner (which is called Local host).

Analysis:
This is used to analyze the test results provided by the controller. This will help
the user to find out the issues and bottlenecks in the application if any.

The information contained herein is proprietary to FMR LLC and shall5not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

LR Best Practices:
This will explain the effective usage of LoadRunner tool. Also it helps the user
on how to come across with the issues faced during the performance testing.

 How do I recover the test data if LoadRunner exits abnormally?

If Load Runner Controller exits before it can gracefully shut down the test run it
doesn’t put the shutdown flags in its data files. Analysis can't read the files without
these flags so the user needs to insert them manually if we want to retrieve the
results.
Here are the methods that are to be followed while doing the retrieving process.
Please note that these methods are done as a trial and error method by editing the
settings in the .lrr file, it is not an official procedure suggested by Mercury, and we
can’t guarantee that it will work all the time. There are other procedures also have
been explained in this document.
[Note: Make sure to save a copy of the original files before editing anything.]

1. Edit the .lrr file.

 Setting a Stop time. There are two ways of retrieving the lost data.
• Approximate stop time known
• Approximate stop time unknown

Approximate stop time known

The method to be followed is doing a simple arithmetic calculation for


calculating the stop time. In some cases we might know approximately when the test
would have got stopped, in such case just calculate the number of minutes and then
convert that to seconds.
For example if we know that the test has stopped abruptly after 3hours into the test
then the stop time would be ((180 *60 = 10800 sec) + Start time (as per the
scenario)).

The information contained herein is proprietary to FMR LLC and shall6not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Let us consider the below example where the test has stopped abruptly after 3 hours.
We can clearly see that there is no stop time. In this case we know that the test has
stopped after 3 hours so we are just adding 10800 seconds to the start time and this
will be our stop time. Then the stop time would be like this
Stop_time=1242418977
Open the .lrr file in notepad, we can see the below contents.
Original File
[Scenario]
Product=HP Load Runner Controller
Version=9.50.0.0
Path=<xxx.lrs>
Subject=<Test name >
Result_file=<xyz.lrr >
Description=
ResultName=<Result name>
Time_Zone=18000
Start_time=1242408177
Daylight_Bias=-60

Edited file

[Scenario]
Product=HP Load Runner Controller
Version=9.50.0.0
Path=<xxx.lrs>
Subject=<Test Name>
Result_file=<xyz.lrr >
Description=
ResultName=<Result name>
Time_Zone=18000
Start_time=1242408177
Daylight_Bias=-60
Stop_time=1242418977

Once we do this and save the file, the .lrr file is now ready to be analyzed and if
we open the analysis file we can get the 3 hour test data results.

The information contained herein is proprietary to FMR LLC and shall7not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

Approximate stop time Unknown

Below the Daylight_Bias line add a Stop_time= line and enter a stop time. To
get a stop time, go to the sum_data/graph_1.dat file. It's plaintext, so open in
Notepad. This is a list of events that occurred during the run so scroll down to the
bottom row and take the 10 digit number that's in the second column.


2. Edit the _t_rep.eve.

 This is the file that tracks events related to the users. The user needs to manually
add the events corresponding to the shut down of the users.
 Below example explains us on how to edit the _t_rep.eve file.

 Open up the _t_rep.eve file in Notepad. For each user, we can see four lines that
look similar to this:
28 4 YIB_OC_LC 23 1176147454 0 yib_oc_lc localhost 0 1
28 0 YIB_OC_LC 23 1176147454 0 localhost 0
28 8 YIB_OC_LC 23 0 0
28 2 YIB_OC_LC 23 1176147454 0 p 0 0

In this example, YIB_OC_LC is the user group name (the Users will be different
for different tests), “23” is the user number, and localhost is the controller box.

 We need to add an extra line for each user to represent the shutdown event. For
every user, add a line to the bottom of the file that looks like this:
28 1 <group name> <user number> <stop time> 0 2

Use same stop time as in the .lrr file in Step 1. If we have got 10 users, then we
need to add ten lines like this. Twenty users, add twenty lines, etc. Use the same
stop time for each.
Finally, we need to finish with a line of numbers. Go to the _t_rep.eve file from
another set of results. Scroll down and copy the last row of numbers, then paste it
into this file.
Example
28 12 <stop time> 0 4222648 1244196511 7794904

 Replace the ten digit number in the second column with the stop time from the
.lrr file.

The information contained herein is proprietary to FMR LLC and shall8not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.
Fidelity Confidential Information © 2009 FMR LLC. All Rights Reserved.

We should now be able to open up the results in Analysis. If we still have


trouble, see if there’s a Data directory containing a file called vu_run.txt in the
results directory. Delete this file and try again.

The information contained herein is proprietary to FMR LLC and shall9not be reproduced, copied in whole or in part, adapted, modified, or
disseminated without the express written consent of FMR LLC.

You might also like