Loadrunner 90 Basics
Loadrunner 90 Basics
0
Training Courseware
By
Softsmith Infotech
www.softsmithinfotech.com
Table of Contents
TABLE OF CONTENTS .......................................................................................2
LOAD TEST .........................................................................................................3
WHAT IS THE PURPOSE OF A LOAD TEST? ...................................................3
LOAD TESTING PROCESS.................................................................................4
LOAD TEST TERMINOLOGIES: .........................................................................4
PERFORMANCE-TESTING EFFORT IN YOUR PROJECT CONTEXT SHOULD
INCLUDE:.............................................................................................................5
LOAD RUNNER: ..................................................................................................7
HOW LOADRUNNER ADDRESSES THE PERFORMANCE TESTING:.............7
VARIOUS COMPONENTS OF LOADRUNNER: .................................................7
WORKING WITH LOADRUNNER........................................................................8
CONTROLLER ...................................................................................................21
CREATING LOAD GENERATORS....................................................................22
DEFINING SLA: .................................................................................................23
ABOUT DEFINING SERVICE LEVEL AGREEMENTS......................................23
GRAPH ANALYSIS:...........................................................................................28
Load Test:
Load Tests are end to end performance tests under anticipated production load. The objective of such
tests are to determine the response times for various time critical transactions and business processes and
ensure that they are within documented expectations (or Service Level Agreements - SLAs). Load tests
also measures the capability of an application to function correctly under load, by measuring transaction
pass/fail/error rates.
Load Tests are major tests, requiring substantial input from the business, so that anticipated activity can
be accurately simulated in a test environment. If the project has a pilot in production then logs from the
pilot can be used to generate usage profiles that can be used as part of the testing process, and can even
be used to drive large portions of the Load Test.
Load testing must be executed on todays production size database, and optionally with a projected
database. If some database tables will be much larger in some months time, then Load testing should
also be conducted against a projected database. It is important that such tests are repeatable, and give
the same results for identical runs. They may need to be executed several times in the first year of wide
scale deployment, to ensure that new releases and changes in database size do not push response times
beyond prescribed SLAs.
Read Transactions
Update Transactions
Comment
Project vision.
understand the current project vision. The project vision is the foundation for
determining what performance testing is necessary and valuable. Revisit the
vision regularly, as it has the potential to change as well.
Purpose of the system. Understand the purpose of the application or system you
are testing. This will help you identify the highest-priority performance
characteristics on which you should focus your testing. You will need to know the
systems intent, the actual hardware and software architecture deployed, and the
characteristics of the typical end user.
Value that performance testing brings to the project. Understand the value
that performance testing is expected to bring to the project by translating the
project- and business-level objectives into specific, identifiable, and manageable
performance testing activities. Coordinate and prioritize these activities to
determine which performance testing activities are likely to add value.
Process. Understand your teams process and interpret how that process applies
to performance testing. If the teams process documentation does not address
performance testing directly, extrapolate the document to include performance
testing to the best of your ability, and then get the revised document approved by
the project manager and/or process engineer.
Project schedule. Be aware of the project start and end dates, the hardware and
environment availability dates, the flow of builds and releases, and any
checkpoints and milestones in the project schedule.
Load Runner:
HP LoadRunner, a tool for performance testing, stresses your entire application to isolate and
identify potential client, network, and server bottlenecks.
HP LoadRunner load tests your application by emulating an environment in which multiple users
work concurrently. While the application is under load, LoadRunner accurately measures,
monitors, and analyzes a systems performance and functionality.
Vusers In the scenario, LoadRunner replaces human users with virtual users or Vusers. When you run a
scenario, Vusers emulate the actions of human users working with your application. While a workstation
accommodates only a single human user, many Vusers can run concurrently on a single workstation. In
fact, a scenario can contain tens, hundreds, or even thousands of Vusers.
Vuser Scripts. The actions that a Vuser performs during the scenario are described in Vuser script.
When you run a scenario, each Vuser executes a Vuser script. The Vuser scripts include functions that
measure and record the performance of your applications components.
Controller. You use the HP LoadRunner Controller to manage and maintain your scenarios. Using the
Controller, you control all the Vusers in a scenario from a single workstation.
Load Generator. When you execute a scenario, the Controller distributes each Vuser in the scenario to
a load generator. The load generator is the machine that executes the Vuser script, enabling the Vuser to
emulate the actions of a human user.
Performance analysis. Vuser scripts include functions that measure and record system performance
during load-testing sessions. During a scenario run, you can monitor the network and server resources.
Following a scenario run, you can view performance analysis data in reports and graphs.
This window opens up as soon as you open the VuGen. You can select the protocol of you application
and click ok. For most of the web application its Web (HTTP/HTML) Protocol
Open VuGen
To start VuGen, choose Start > Programs > <App_Name> (for example LoadRunner) > Applications >
Virtual User Generator from the Start menu.
To open an existing script, not in the recent list, click Open Existing Script.
To create a new script using a recent protocol, click the protocol in the
Recently used protocols list.
To create a new script in a protocol that is not listed, click New Vuser Script.
Choose File > Zip Operations > Import From Zip File to open an existing cript from a zip archive.
Now click on the New Protocol Script and you will see the following Window. From this window you
have to choose the protocol on which the application you are going to load test works.
VuGen provides a variety of Vuser technologies that allow you to emulate your system. Each
technology is suited to a particular architecture and results in a specific type of Vuser script. For
example, you use Web Vuser Scripts to emulate users operating Web browsers. You use FTP Vusers to
emulate an FTP session. The various Vuser technologies can be used alone or together, to create
effective load tests or Business Process Monitor profiles.
Now Set the Recording Options for recording the user actions of the application under load test.
Now that you are ready for recording Click on the record button
Give the Url of the application that needs to be load tested like the one below
The following table describes the criteria for determining the business functions or processes to
be included while recording
Basis for inclusion in Load Test
High frequency transactions
Read Transactions
Update Transactions
Comment
The most frequently used transactions have the potential to
impact the performance of all of the other transactions if
they are not efficient.
The more important transactions that facilitate the core
objectives of the system should be included, as failure
under load of these transactions has, by definition, the
greatest impact.
At least one READ ONLY transaction should be included,
so that performance of such transactions can be
differentiated from other more complex transactions.
At least one update transaction should be included so that
Now the script will be generated for the recorded user actions and will be displayed like this
The above one is called the Script view. It can also be viewed as Tree view
Tree view:
Now you need to perform Correlation in the script. The purpose of Correlation is
To simplify or optimize your code
For example, if you perform a series of dependent queries one after another, your code may
become very long. To reduce the size of the code, you can nest the queries, but then you lose
precision and the code becomes complex and difficult to understand. Correlating the statements
enables you to link queries without nesting.
To generate dynamic data
Many applications and Web sites identify a session by the current date and time. If you try to
replay a script, it will fail because the current time is different than the recorded time. Correlating
the data enables you to save the dynamic data and use it throughout the scenario run.
The main steps in correlating a script are:
1 After Running the script once click on can for correlation button
chapters for an explanation on how to perform correlation. In several protocols, such as database
and Web, VuGen automatically inserts the functions into your script.
4 Reference the saved values.
Replace the constants in the query or statement with the saved variables.
Once you click like the above one you need to give the name for the parameter as in below one
Now we can run the script in stand alone mode to check if the scripts are running properly
Once the scripts are running fine in stand alone mode , these scripts can be placed in controller
for funning the load test.
Controller
To open the Controller:
Manual Scenario. Select this method if you want to build a manual scenario. You build a manual
scenario by creating groups and specifying the script, the load generator, and the number of
Vusers included in each group.
Use the Percentage Mode to distribute the Vusers among the scripts. Select this option if you
want to build a manual scenario by specifying a number of Vusers to be distributed among the
selected Vuser scripts.
Goal Oriented Scenario. Select this method to have LoadRunner build a scenario for you. In a
goal-oriented scenario, you define the goals you want your test to achieve, and LoadRunner
automatically builds a scenario for you, based on these goals.
Defining SLA:
An SLA is a formally negotiated agreement between two parties. It is a contract that exists
between customers and their service provider, client or between service providers. It records the
common understanding about services, priorities, responsibilities, guarantee, and such
collectively, the level of service. For example, it may specify the levels of availability,
serviceability, performance, operation, or other attributes of the service like billing and even
penalties in the case of violation of the SLA.
When you design a load test scenario, you can define goals or service level agreements (SLAs)
for the performance metrics. When you run the scenario, LoadRunner gathers and stores
performance-related data. When you analyze the run, Analysis compares this data against the
SLAs and determines SLA statuses for the defined measurements.
SLA status determined per time interval within the run. Analysis displays SLA statuses at set
time intervalsfor example, every 10 secondsover a timeline within the run.
SLA status determined over the whole run. Analysis displays a single SLA status for the whole
scenario run.
And once you run the scenario you will get the details like this
Graph Analysis:
During load test scenario execution, Vusers generate result data as they perform their
transactions. The Analysis graphs help you determine system performance and provide
information about transactions and Vusers. You can compare multiple graphs by combining
results from several load test scenarios or merging several graphs into one.
The Report utilities enable you to view a Summary HTML report for each graph or a variety of
Performance and Activity reports. You can create a report as a Microsoft Word document, which
automatically summarizes and displays the tests significant data in graphical and tabular format.
Starting Analysis
You can open Analysis as an independent application or directly from the Controller. To open Analysis as an
independent application, choose one of the following:
Transaction Summary
This section displays a table containing the load test scenarios diagnostics data. Included in this
data is a percentile column (x Percent). This column indicates the maximum response time for
that percentage of transactions performed during the run. For example, in the table below, the
value in the 88 Percent column for browse special books is 8.072. This means that the response
time for 88% of the browse special books transactions was less those 8.072 seconds.
X Worst Transaction
The X Worst Transactions table shows the worst transactions in terms of how often the transactions exceeded the
SLA boundary during the run, and by how much.
SLA Report
An SLA (Service Level Agreement) defines goals for the load test scenario. LoadRunner
measures these goals during the scenario run and analyzes them in the Summary report. The SLA
Report shows the succeeded or failed status of all SLAs that were defined for the scenario run.
Displays the average time taken to perform transactions during each second of the load
test. This graph helps you determine whether the performance of the server is within
acceptable minimum and maximum transaction performance time ranges defined for your
system.
Throughput
Displays the amount of throughput (in bytes) on the Web server during the load test.
Throughput represents the amount of data that the Vusers received from the server at any
given second. This graph helps you to evaluate the amount of load Vusers generate, in
terms of server throughput.
Transaction Summary
Displays the number of transactions that passed, failed, stopped, or ended with errors.
Displays the average download time (in seconds) for each Web page and its components.
Windows Resources
Displays a summary of the System Resources usage for each Windows based host.