8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
1/157
LOADRUNNER
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
2/157
Types of Performance Testing
2Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
3/157
Performance Test Objectives
3Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
4/157
Load Testing in the Product Life Cycle
4Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
5/157
The LoadRunner Solution
5Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
6/157
The LoadRunner Methodology
6Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
7/157
LoadRunners Load Testing
Components
7Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
8/157
The LoadRunner Launch Screen
8Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
9/157
Components
Accurate scripts form the foundation of an effective load test. Once
planning is completed the next step is to move to scripting. Scripting is
done in VuGen.
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.
9Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
10/157
Supported Protocols
10Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
11/157
What is a Scenario?
A scenario is a file that defines the scripts to execute, the number of
Vusers to run, the goals of the test, the computer that will host the
Vusers, and the conditions under which the load test runs.
Using LoadRunner, you divide your application performance testing
requirements into scenarios.
A scenario defines the events that occur during each testing session.
11Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
12/157
What is the Controller?
You use the LoadRunner Controller to manage and maintain your
scenarios.
Using the Controller, you control all the Vusers in a scenario from a single
workstation.
12Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
13/157
LoadRunner Performance Monitoring
13Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
14/157
LoadRunner Performance Monitors
14Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
15/157
The Load Testing Process
15Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
16/157
16
Quiz
What is LoadRunner?
What are the versions of LoadRunner?
What is VuGen?
What is Controller?
What is Analysis? What is a Load Generator?
What is monitoring?
What are performance objectives?
What is planning in Load Testing?
Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
17/157
17Sampath Velupula
Planning
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
18/157
Business Process
A business process is a set of actions or user steps performed within an
application to accomplish a business goal.
In the context of LoadRunner, it is a series of steps performed against the
application under test.
Just clicking a button is not a business process. It is only a step. A realbusiness process consists of taking an actual action such as finding
information, making a purchase, or changing an order.
The individual tasks and functions performed by the users in the
application are often called business processes.
Heavy Throughput: Business processes that may not be mission-criticalbut are very popular.
Sampath Velupula 18
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
19/157
Business Process
Sampath Velupula 19
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
20/157
What is Think Time?
LoadRunner Think Time is a measurement of the time that a real user
takes to pause between the execution of steps.
Users interact with an application according to their experience level and
objectives.
More technically proficient users may work very quickly.
New users and those involved in certain kinds of business processes may proceed very
slowly.
By estimating these navigation times, virtual users can be made to
emulate their real world counterparts more accurately during a load test.
20Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
21/157
What is a Concurrency?
A concurrency is a set of users acting upon an application in a similar
manner at the same time.
Concurrency occurs on three levels:
Application Level
How many users are active on the system?
Business Process Level How many users are buying tickets?
Transaction Level
How many users are buying tickets now?
21Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
22/157
Application Concurrency
22Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
23/157
Business Process Concurrency
23Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
24/157
Transactional Concurrency
How many transactions will need to be run per minute if a loadtest has to be run for two hours with 5000 users, assuming anaverage length of five minutes?
Determine how many transactions run per minute:
120 minutes / 5 minutes = 24 iterations for each user.
5000 users X 24 iterations = 120,000 transactions. 120,000 transactions / 120 minutes = 1000 transactions per minute.
Apply the transactional concurrency to the application (refer tothe Application concurrency figures):
The test is run during the 10-12 AM time slot.
The test should consist of 5000 users running 24 iterations. The system must be able to handle 1000 transactions per minute.
24Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
25/157
User Profile
25Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
26/157
Peak Load
26Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
27/157
Where are Your Customers Located?
27Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
28/157
Monitoring Application Components
28Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
29/157
29Sampath Velupula
Components
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
30/157
Where to Install Each Component
VuGen (Virtual User Generator) Allows you to create scripts. These scripts emulate
human users on playback.
ControllerAllows you to design Scenarios, run and stop the load test. Scenario files have
the .lrs extension.
Load Generator When a scenario is running, the results are stored locally on each load
generator machine by default. After the scenario stops running, the performance data from
each load generator machine is sent to the results file that you have specified.
AnalysisProcesses the gathered scenario results and generates graphs and reports. When
you work with the Analysis tool, you work within a session that contains at least one set of
scenario results contained in a file ending .lrr. After the results are processed by the
Analysis tool, the file is saved as .lra.
30Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
31/157
WAN Emulation
31Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
32/157
WAN Emulation
WAN emulation software mimics the WAN/Internet by slowing,
dropping, and changing packets between client and server.
Should be installed on all load generator machines (requires a separate
install and license).
Discover how certain elements affect the performance of your site when
remote users connect.
Network latency
Packet loss
Packet duplication
Packet fragmentation
Bit error rates
32Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
33/157
33
Quiz
Please give me the file extensions for each componentin LoadRunner.
Please tell me what is WAN Emulation.
Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
34/157
34Sampath Velupula
Vuser
Generator
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
35/157
Testing Process
Planning the Test
Creating Vuser scripts
Creating the scenario
Running the scenario
Monitoring the scenario
Analyzing Test Results
Sampath Velupula 35
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
36/157
Script Development
Record a basic Vuser script
Enhance and edit the script
Configure run-time settings
Run the Vuser script in stand-alonemode
Incorporate the Vuser script into aLoadRunner scenario
Sampath Velupula 36
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
37/157
Protocols
37Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
38/157
Creating a script using Virtual User
Generator1. Recording user actions
2. Adding LoadRunner Transactions
3. Parameterizing input data
4. Adding verification checks
5. Correlating reused data6. Verifying correct execution of the script
38Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
39/157
What is a Script?
A Script emulates the steps of real users using the application. A VuGen
script, also known as a Virtual User (vuser) or Transaction File, is the
recorded user actions captured by Virtual User Generator.
When played back, the file interacts with an application just like a real
user. In a load test, data from this interaction is reported back to
LoadRunner Analysis allowing for systematic diagnosis of the root cause
problem.
The script file itself is a ANSI-C script file that supports all programming
conventions available to the C programming language, as well as
functions specific to VuGen scripts.
39Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
40/157
Recording
Virtual UserGenerator
Browser(Client)
Proxy
(Createdby VuGen)
Server
Monitor communication betweenclient and server
Generate required function callsInsert generated function calls into Vuser script.
Sampath Velupula 40
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
41/157
Recording
41Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
42/157
Recording Options Use a threshold value for think time. If the recorded think time is less than the
threshold.
Selecting a recording level in VuGen lets you specify the information to be
recorded and which functions to use when generating the script.
HTML-based script
URL-based script.
For LoadRunner scripts, HTML level is a common choice. On very complexweb applications, the entire script may need to be recorded at URL level.
42Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
43/157
Recording Options
Setting the Recording Level:
Sampath Velupula 43
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
44/157
Recording Options HTML is a higher level that records in "Browser" or "Context Sensitive" mode.
This setting allows the Browser to determine which page resources (such as
images or Flash content) should be downloaded depending on the HTML source
that was downloaded during replay.
HTML level will generate a web_submit_form statement
URL is a lower level that records in "Analog" mode. This setting does not allow
the browser to determine which page resources (such as images or flash) shouldbe downloaded. Each resource is recorded in the script during the Recording
session. This level will also record any hidden items, such as session information,
sent to and from the server.
URL Level will generate a web_submit_data statement
44Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
45/157
Recording
45Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
46/157
Vuser.usr
46Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
47/157
default.cfg
47Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
48/157
Script Details
48Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
49/157
Exercise
Start Recording Stop Recording
Recording Summary
Work with Thumbnails
View the Script in Tree view
Understand snapshots
Rename steps
Return to workflow wizard
Save script
Sampath Velupula 49
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
50/157
Recording Summary
Once the recording is completed, the workflow moves to the Recording
Summary step.
Thumbnails display the snapshot in HTML as they would appear in a
browser, making it easier to select the correct step.
Now the script is ready for further enhancement and editing. You can do
so in
Workflow Wizard viewTask View
TREE VIEW
SCRIPT VIEW.
50Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
51/157
Tree View
URL: A URL icon is added to the script when you type in a URL or use a
bookmark to access a specific web page.
Link: A link icon is added to the script when you click a hypertext link
while recording. Each link icon represents a web_link function in the
script.
Image: An image icon is added to the script when you click a hyperlink
attached to an image while recording. Each image icon represents a
web_image function in the script.
Form/Data Submission: A Submit Form or Submit Data icon is added to
the script when you submit a form while recording.
51Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
52/157
Recording Snapshots
Page View: Displays the snapshot in HTML as it would appear in a
browser. This button is available for both the Recording and Replay
snapshots. Use this view to make sure you are viewing the correct
snapshot.
Server Response: Displays the server response HTML code of the
snapshot. This button is available for both recorded and replayedsnapshots. The HTML view also shows a tree hierarchy of the script in
the left pane, with a breakdown of the document's components: Header
and Body with the title, links, forms, etc.
Client Request: Displays the client request HTML code of the snapshot.
This button is available for both the recorded and replayed snapshots.The HTML view also shows a tree hierarchy of the script in the left pane,
with a breakdown of the document's components: Header and Body and
their subcomponents.
52Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
53/157
Run-time Settings
Run-time settings definethewayin which a scriptruns.
Stored in the default.cfgin the Vuser script directory.
Applied to Vusers when the script is executed using VuGen or the Controller.
Configuring run-time settings enable you to emulate different kinds of user
activity.
General run-time settings include: Run LogicNumber of times the actionblock of the script executes
(iterations)
Pacingthe time between iterations.
Loghow much information is logged to the output.
Thinktimeemulates the time a real user waits between actions.
Sampath Velupula 53
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
54/157
Replay
After recording, always play back the script to verify that the script is
running as intended.
The goal is to perform a "sanity check" before the script is assigned in
the Controller.
Test the script with just one iteration to verify basic functionality.
Configure RUN-TIME SETTINGS to test specific aspects of the script.
It is strongly recommended that you re-run the script after any
modifications or enhancement to verify the integrity of the script.
Click the START REPLAY button to play back the script.
54Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
55/157
Run-time Settings
Run Logic defines how to set iterations
Log: During playback, scripts log information about themselves and their
communication with the server.
These messages can be captured in the REPLAY LOG by checking (enabling) the
Extended Log before playing back the script.
Proxy: A proxy server acts as an intermediary between a workstation andthe Internet so that the enterprise can ensure security, administrative
control and caching.
55Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
56/157
Run-time Settings
Sampath Velupula 56
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
57/157
Run-time Settings
Sampath Velupula 57
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
58/157
General Settings
Animated run delay: Allows you to toggle between running a script inanimated and non-animated modes.
When you run in animated mode, VuGen highlights the line of the script being
executed at the current time.
Prompt for results directory: Prompts you for a results directory before
running a script from VuGen. After replay show: Instructs VuGen how to proceed after the replay.
Auto show function syntax: When you type the opening parenthesis of a
function
Auto complete word: When you type the first underscore of a function
Display Tab: allows you to specify whether VuGen displays the run-time
viewer
58Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
59/157
REPLAY LOG
When script execution is complete, you examine the messages in theREPLAY LOG to see whether your script ran without errors.
Various colors of text are used in the Replay Log:
Black: Standard output messages
Red: Standard error messages
Green: Literal strings that appear between quotation marks (e.g. URLs)
Blue: Transaction Information (starting. ending. status and duration)
Orange: The beginning and ending of iterations.
59Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
60/157
Debugging Tools
Run-Time Viewer: The run-time viewer shows each web page as it isaccessed by the script This is useful for debugging, as it allows you to
check whether a script has accessed the correct web page or not.
Replay Summary: When the script execution is complete, displays the
summary of the script status.
Test Results window: Summarizes the success or failure of each step of
the playback web script
Replay Log: When the script execution is complete, communications
between the script and the server are listed in the REPLAY LOG.
Snapshot Results window
Page View
Server Response
Client Request
60Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
61/157
Example Script
Sampath Velupula 61
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
62/157
Transactions
Transactions are defined to measure the performance of the server.
Each transaction measures the time it takes for the server to respondto
specified Vuser requests.
The Controller measures the time taken to perform each transaction
during the execution of a performance test.
Sampath Velupula 62
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
63/157
Transactions
LoadRunner's means of measuring elapsed response time of one or moreuser steps
Implemented by adding Start Transaction and End Transaction steps
May overlap and may be nested
May be added during or after recording
Lr_start_transaction, lr_end_transaction
Always use name as AppName_TransactionNumber_Process
Automatic Transaction in Run-time settings
Transactions help: To measure mission-critical, heavy throughput and dynamic content business
processes. In determining the nature ofApplication problems.
In estimating which business process is failing by tracing the failed transactions
With reporting the failed business process to Analysis graphs.
Sampath Velupula 63
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
64/157
Exercise
New Transaction
Transaction Editor
Transactions during recording
Sampath Velupula 64
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
65/157
Parameterization
Parameterizing the scripts eliminates problems that can cause errors inyour testing or produce misleading load test results.
When a script contains parameterized data, virtual users can make varied
selections. This makes a test much more true to life, and therefore much
more likely to create realistic results.
Sampath Velupula 65
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
66/157
When to Parameterize
Unique Constraint While a virtual user is logged in with the 'jojo' username, any other user who tries to
log in with the same username will get an error
Date Constraint
A date recorded into a script yesterday may be invalid today.
Data Dependency Whenever the parameterized value for an object on the application determines what
values are valid for another object on the application
Data Caching
Data caching problems will not cause your script to fail, but they may cause load test
result to be misleading.
Sampath Velupula 66
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
67/157
Exercise
Parameterize Input Data Steps
Sampath Velupula 67
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
68/157
Parameter Types
Internal Data Date/Time
Random Number
Unique Number
Iteration Number
Load Generator Name
Vuser ID
File Parameter Types Data files are data contained in a file - either an existing file or one that you create
with VuGen.
Data files hold data that a script accesses during execution. Data can be stored in localor global fi les
Table Parameter Types
XML Parameter Types
Sampath Velupula 68
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
69/157
User-Defined Function Parameters
Data that is generated using a function from an external DLL.
A user-defined function replaces the parameter with a value returned
from a function located in an external DLL.
__declspec(dllexport) char *(char *, char *)
When you create the library, we recommend that you use the default
dynamic library path.
69Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
70/157
Data Access Methods
Sequential Method
Random Method
Unique (by Row) Method
Same Line as Method
Runtime settings: Log -> Parameter Substitution
Sampath Velupula 70
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
71/157
Auto Correlation
Replay of Script Indicates Error
Dynamic Value Recorded:
HTML pages often contain dynamic data, which is data that changes each time you
access a site.
Login string, Date/Time Stamp, Common Prefix
Sampath Velupula 71
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
72/157
Auto Correlation
Correlate the Script:
VuGen correlation is the process of enhancing the VuGen script to
process the dynamic data passed between the client (browser, or VuGen)
and server, just like a live browser.
Automatic correlation can be done during or after recording
To work correctly, automatic correlation requires at least one playback.
Correlation after recording uses a built-in comparison utility. Allows you
to view the text or binary differences between the recording and
playback snapshots
VuGen inserts a web_reg_save_param function and a comment into yourscript indicating that a correlation was done for the parameter.
Manually insert correlation functions
Sampath Velupula 72
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
73/157
Manual Correlation
Find the differences using Wdiff Locate the string and its details
Identify Patterns using Boundaries
Identify the string that is immediately to the left of the dynamic data.
Identify the string that is immediately to the right of the dynamic data.
web_reg_save_param_ex
Identify Patterns using Xpaths
web_reg_save_param_xpath web_set_max_html_param_len("512");
web_reg_save_param("serverHost", "NOTFOUND=ERROR",
"LB=", LAST); web_reg_save_param("serverArgs", "NOTFOUND=ERROR",
"LB=", LAST);
73Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
74/157
74
Auto Correlation
Steps:
Set General Options and play back the script.
Review the Replay Summary.
If dynamic values were detected, scan for dynamic
values.
Analyze the correlation results.
Correlate the dynamic value by pressing the Correlate
button.
Verify correct execution.
Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
75/157
Verifications
A load test is always performed after functional testing. Attention should bepaid to the functionality of the application while it is load tested to ensurethat what worked correctly under low load still works correctly under heavierload.
VuGen allows you to add Checkpoints for verification automatically and alsoprogrammatically.
A text check is a search for a specified text string on a web page. Adds web_reg_find registration function to the script.
Registration means that it does not execute the search immediately, but performs the checkwhile the page is being downloaded.
Once the Checkpoint is added, replay the script. To make sure that the textcheck passed view the Replay Log by clicking on the REPLAY LOG link in the
Last Replay Summary View the success of the Checkpoint in the TEST RESULTS by clicking on the
VIEW VISUAL TEST RESULTS link
75Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
76/157
Actions
Action: In VuGen is a set of recorded user steps in a script that allow youto emulate a particular user task through script iteration.
VuGen allows you to emulate user activities by grouping tasks sections
called Actions
There are three default Actions that a new script contains: vuser_init,
Action and vuser_end.
Example:
Log in recorded in Vuser_init
Create New Order inAction
Logout in Vuser_end
An Action is composed of steps (user or loadrunner steps)
76Sampath Velupula
Why Record the Script with Multiple
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
77/157
Why Record the Script with Multiple
Actions? Scripts can be divided into logical sections (Actions), like the main
sections of a business process, or by specific business process.
Multiple actions help you design more modular and efficient scripts.
Example Actions:
Log in - VlIser_init
Create New Order -Action
Modify Order -Action
Logout - Vuser_end
77Sampath Velupula
d
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
78/157
Record Login In Vuser_init or Not?
Should each Vuser log in as a different user on each iteration?
Should login be iterated frequently?
Do you want to measure the response time for the login?
Will you want to measure the ramp up effect on the login?
78Sampath Velupula
l k
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
79/157
Action Blocks
Action blocks are groups of actions within your script. When runningscripts with multiple actions, blocks help you with grouping allowing you
to iterate some actions more frequently than others.
Open the RUN-TIME SETTING. Select the GENERAL: RUN LOGIC node.
Add a new action block. Click INSERT BLOCK. VuGen inserts a new Action
block at the insertion point with the next available index (BlockO. Block I,Block2).
Add the desired actions to the block by Clicking INSERT ACTION and then
by selecting the actions from the Actions list.
79Sampath Velupula
i l k i
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
80/157
Action Block Properties
Sequence: You can set the order of actions within your script. You canalso indicate whether to perform actions SEQUENTlALLY or RANDOMLY.
Iterations: In addition to setting the number of iterations for the entire
Run section, you can set iterations for individual actions or action blocks.
Weighting: For action blocks running their actions randomly, you can set
the weight or percentage of each action within a block. Allows you toiterate some actions more frequently than others.
80Sampath Velupula
Entering Steps or Function in the
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
81/157
Entering Steps or Function in the
Script View
There are two ways to add new steps or functions to a script in theSCRIPT VIEW.
Use the INSERT ---7 NEW STEP command.
Enter steps or functions manually.
81Sampath Velupula
R d i
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
82/157
Rendezvous points
Rendezvous points are used to synchronize Vusers to perform a task atexactly the same momentto emulate heavy user load.
When a Vuser arrives at a rendezvous point, it is held by the Controller
until all Vusers participating in the rendezvous reach that point.
You may only add rendezvous points in the Actionsectionnot to the
initor end
Sampath Velupula 82
R d i
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
83/157
Rendezvous points
Sampath Velupula 83
C fi ti Fil
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
84/157
Configuration Files
vuser_init.c
Action.c
vuser_end.c
.usr
globals.h
default.usp
default.cfg
The C files are the initial script actions files added to a new script.default.usp is the default run logic.
globals.h contains the include statement for this protocol's header andsometimes other declarations.
The run-time settings configuration file, default.cfg, contains the default
run-time settings. The .usr file contains the initial configuration for a new
script.
84Sampath Velupula
T l t Fil
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
85/157
Template Files
The \merc_asl\< protocol id>.asl file lists the APIfunctions of the protocol
File \dat\mdrv\mdrv_.dat is the
configuration file of the mdrv process.
The \dat\_steps.dat file configures
presentation of steps in the Insert Step dialog and elsewhere in the VuGen userinterface.
The \bin\vslick\builtins\RuntimesCpp.h
file contains the formats of the API functions as they are displayed by
IntelliSense, with a few comment lines for each function.
The \bin\vslick\.vlx file contains the API
function names and keywords.
The file \dat\protocols\.lrp is the master
configuration file for the protocol.
85Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
86/157
86Sampath Velupula
Controller
Wh t i S i
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
87/157
What is a Scenario
87Sampath Velupula
Th L dR C t ll
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
88/157
The LoadRunner Controller
The Controller organizes and manages the scenario elements Before scenario execution
used to design the scenario
used to initiate the scenario run
During scenario execution
controls each Vuser (initialize, run, pause, stop) displays the execution status and messages of each Vuser
monitors system and network resources
After scenario execution
collects and organizes performance data
launches the Analysis tools (optional)
88Sampath Velupula
S i O tli E l
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
89/157
Scenario Outline - Examples
number of Vusers pages per minute
transaction per second
transaction response time
89Sampath Velupula
C ti N S i
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
90/157
Creating a New Scenario
90Sampath Velupula
Sele t V ser S ripts
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
91/157
Select Vuser Scripts
91Sampath Velupula
Vuser Groups
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
92/157
Vuser Groups
92Sampath Velupula
Adding a Vuser Group
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
93/157
Adding a Vuser Group
93Sampath Velupula
Manual vs Goal Oriented Scenarios
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
94/157
Manual vs. Goal-Oriented Scenarios
94Sampath Velupula
Manual vs Goal Oriented Scenarios
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
95/157
Manual vs. Goal-Oriented Scenarios
Manual Scenario Manual control over how many Vusers run and at what times.
Add, start, and stop Vusers interactively during a scenario run.
Goal-Oriented Scenario
Goal may be throughput, response time or number of concurrent Vusers.
LoadRunner manages Vusers automatically.
Cannot add, start, or stop Vusers interactively during a scenario run.
95Sampath Velupula
Which Scenario Type to Choose?
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
96/157
Example
96Sampath Velupula
Load Generators
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
97/157
Load Generators
97Sampath Velupula
Adding a Load Generator
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
98/157
Adding a Load Generator
98Sampath Velupula
Vuser Run time Settings
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
99/157
Vuser Run-time Settings
Sampath Velupula 99
Vuser Run time Settings
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
100/157
Vuser Run-time Settings
Run Logic Is used to model more closely the way real users interact with the application.
Pacing
Controls the delay between iterations
Log Settings
Different types of information are logged depending on the options selected. Think Time
LoadRunner Think Time is a measurement of the time that a real user takes to pause
between the execution of steps in a business process. Additional Attributes
Additional attributes allows you to pass parameters to prepared scripts, enablingthe testing and monitoring of servers with different client parameters.
Miscellaneous Settings
100Sampath Velupula
Additional Settings for Web Vusers
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
101/157
Additional Settings for Web Vusers
Network Configures bandwidth to emulate real-user behavior on the application.
Browser Emulation
Emulates different browsers to test user experience on response times and content
availability.
Proxy Configures Vusers to obtain proxy settings either from the default browser or to
bypass proxy and make direct connections to the Internet.
Preferences
Generates analysis graphs by selecting options under Generate Web Performance
Graphs.
101Sampath Velupula
Running Scenarios
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
102/157
Running Scenarios
Load Generators at run time: Results are stored locally on each load generator.
After execution, results from all load generators are transferred to the Controllers
results directory for analysis.
LoadRunner Controller at run time:
Saves transactions and performance monitor data. Synchronizes Vusers via rendezvous function (optional).
Collects error and notification messages generated by Vusers.
102Sampath Velupula
Rendezvous Point
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
103/157
Rendezvous Point
An intersection point in a business process A Rendezvous is a step added during script creation and defined in
VuGen.
To use a Rendezvous, it must be configured in the Controller.
When a Rendezvous is present in a script, transaction times become
meaningless.
A Rendezvous policy may be defined in three ways
Percentage of all users (What if everybody tried to log in now?)
Percentage of all running Vusers (50% of users arrive between 8AMand 9AM)
Number of users (What if 10 clients try to log in now?)
When using Rendezvous - why does transaction time become
meaningless?
103Sampath Velupula
Executing Scenarios as a Team is
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
104/157
Recommended
104Sampath Velupula
Top Time Transaction
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
105/157
Top Time Transaction
A LoadRunner transaction that requires significantly longer to completethan other transactions or takes significantly longer than established
goals under relatively small load.
Isolating top time transactions run helps us to understand the
applications responsiveness and allows us to focus on major problem
areas.
105Sampath Velupula
Scenario Executions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
106/157
Scenario Executions
Debug Run Shows the responsiveness of the site under low stress.
Isolate Top Time Transactions
The isolate top time transactions run helps us to understand the applications
responsiveness and allows us to focus on major problem areas.
Full Load The entire expected load is applied using a slow ramp up.
Scalability Test
Determine whether your system is scalable for increased load.
106Sampath Velupula
Vuser Status - Under Controller Run
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
107/157
Tab
107Sampath Velupula
Initializing Vuser Groups
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
108/157
Initializing Vuser Groups
108Sampath Velupula
Understanding Vuser Status
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
109/157
Understanding Vuser Status
109Sampath Velupula
Vuser Window and Vuser Log
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
110/157
Vuser Window and Vuser Log
110Sampath Velupula
Scenario Status - Controller Run Tab
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
111/157
Scenario Status Controller Run Tab
Common Run Time Errors TIMEOUT
HTTP 500
111Sampath Velupula
Scheduling Scenarios
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
112/157
Scheduling Scenarios
Enables the repetition of important usage patterns throughout loadtesting for the defined duration of the load test.
112Sampath Velupula
Configure Schedule Settings
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
113/157
Configure Schedule Settings
Configure Scenario Start Time
Schedule by Scenario
Schedule by Group
Ramp Up
Ramp Down
Scenario Duration
Run until completion
Run for
Run indefinitely
113Sampath Velupula
The Value of Performance Monitors
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
114/157
The Value of Performance Monitors
Performance monitors may detect such things as: Web server memory usage is at the maximum
Low activity is registered by the database server
Underutilization of the application server
114Sampath Velupula
LoadRunner Performance Monitors
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
115/157
LoadRunner Performance Monitors
115Sampath Velupula
Set Monitoring Options
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
116/157
Set Monitoring Options
116Sampath Velupula
Configure Monitors
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
117/157
Configure Monitors
117Sampath Velupula
Monitor Measurements
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
118/157
Monitor Measurements
118Sampath Velupula
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
119/157
119Sampath Velupula
Analysis
Root Cause Analysis
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
120/157
Root Cause Analysis
Performing root cause analysis means drilling down from the mostgeneral reports to localized metrics
Compare results against goals - confirm performance has not met expectations.
Identify potential bottlenecks - list all the pieces of the system which might have
caused that slowdown.
Correlate results - determine the most likely culprit by correlating transaction times
and backend monitor metrics.
120Sampath Velupula
Did You Meet Your Goals
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
121/157
Did You Meet Your Goals
121Sampath Velupula
Average Transaction Response Time
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
122/157
g p
Details transaction response throughout the test.
Identifies problematic transactions.
Identifies problematic points in the test.
Response time exceeded the goal at about 20+ minutes into the test.
122Sampath Velupula
Average Transaction Response Time
U d L d
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
123/157
Under Load
Details transaction response time as a function of load. Identifies under what load conditions transaction times begin to
degrade.
By looking at the Average Transaction Response Time Under Load, we
can see response time degrades above ~70 users.
123Sampath Velupula
Transaction Response Time Percentile
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
124/157
p
Details transaction response time as a service level.
Identifies percentage of transactions complete over time.
The project manager has defined the Service Level Agreement as 99.9%
(or greater!).
124Sampath Velupula
Transaction Response Time
Di t ib ti
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
125/157
Distribution
Details transaction response time as a distribution count. Identifies number of transactions complete over time.
By drilling down on a transaction (Credit), we can see that most of the
customers seem to be within the Service Level.
125Sampath Velupula
Isolating Network Issues
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
126/157
g
Network Delay Time shows spikes in latency, indicating network issues. Network Sub-Path Time shows a hop with spikes, confirming network
issues.
126Sampath Velupula
Time to First Buffer Breakdown
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
127/157
Time to First Buffer is the period between a browser request and the firstreply.
Provides high level Server vs. Network determination.
it is useful to isolate Server vs. Network in an effort to quantify
where a majority of the time is spent.
127Sampath Velupula
Page Download Time Breakdown
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
128/157
g
Identifies Web pages that take the most time and isolates where time isspent.
Helps isolate DNS resolution issues, SSL issues, and connection issues.
128Sampath Velupula
Auto Correlation
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
129/157
Auto Correlation Allows automatic selection of graphs to correlate in order to find the metrics that most
influence the transaction response time
Automatically correlates the transaction graph with all performance metrics and
displays the ones that show the highest match in their behavior; this allows you to
disregard irrelevant metrics
Visually displays correlated metrics closely correlated to the transaction responsetime, which speeds identification of the likely causes of performance bottlenecks
Auto Correlation lets you correlate a measurement in a graph with other
monitor measurements during a specific time range of the scenario. This
enables you to view similar measurement trends.
129Sampath Velupula
Auto Correlate - Time Range
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
130/157
g
Details transaction response time as a distribution count. Identifies number of transactions complete over time.
By drilling down on a transaction (Credit), we can see that most of the
customers seem to be within the Service Level.
130Sampath Velupula
Quiz
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
131/157
Quiz
Sampath Velupula 131
Report Metrics
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
132/157
p
Load size: The number of concurrent Virtual Clients trying to access thesite.
Throughput: The average number of bytes per second transmitted from
the ABT (Application being tested) to the Virtual Clients running this
Agenda during the last reporting interval
Round Time: It is the average time it took the virtual clients to finish onecomplete iteration of the agenda during the last reporting interval.
Transaction Time: The time it takes to complete a successful request, in
seconds. (For a web-based application, each request for each gif, jpeg,
html file, etc. is a single transaction.) The time of a transaction is the sum
of the Connect Time, Send Time, Response Time, and Process Time Connect Time: The Time it takes for a Virtual client to connect to the
Application Being Tested.
Sampath Velupula 132
Report Metrics
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
133/157
p
Send Time: The time it takes the Virtual Clients to write a request to theABT (Application being tested), in seconds.
Response Time: The time it takes the ABT(Application being tested) to
send the object of a request back to a Virtual Client, in seconds. In other
words, the time from the end of the request until the Virtual Client has
received the complete item it requested. Process Time: The time it takes to parse a response from the ABT
(Application being tested) and then populate the document-object
model (the DOM), in seconds.
Wait Time (Average Latency): The time it takes from when a request is
sent until the first byte is received. Receive Time: The elapsed time between receiving the first byte and the
last byte.
Sampath Velupula 133
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
134/157
Functions
Sampath Velupula 134
Common Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
135/157
Message functions lr_error_message and lr_output_message
Send messages to the output, indicating an error or a warning.
Transaction Functions
lr_start_transaction and lr_end_transaction
Add transactions and synchronization points to a script. For example, thelr_start_transaction function marks the beginning of a transaction, and the lr
end transaction function marks the end of a transaction.
Run-Time Functions
lr_think_time and lr_exit
Parameter Functions lr_save_date time, lr_advance param, lr eval string, lr_save string and lr get
attrib_string
135Sampath Velupula
Common Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
136/157
Ir_abort Aborts the execution of a script. It stops the execution of the Actions section, executes
the vuser_end section, and ends the execution:
Ir exit
lr exit (int continuation_option, int exit status);
lr_exit(LR_EXIT VUSER, LR_FAIL);
Exits from the script, action, or iteration:
Ir_save_string
Assigns the specified null-tenninated string to a parameter:
lr_save_string(canst char *param_value, canst char *param_name);
This function is useful in correlating queries.
lr_save_string(777, emp_id);
136Sampath Velupula
Common Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
137/157
Ir_save_date_time Saves the date and time into a parameter:
lr save_date_time(const char *format, int offset, canst char *name};
Ir_advance_param
Advances to the next available value in the parameter data file:
lr_advance_param (const char * param);
Ir_eval_string
Returns the value of the parameter as a string.
lr eval string("(parameter name)");
Ir_get_attrib_string
Assigns the specified null-tem1inated string to a parameter
lr_get_attrib string (canst char * argument);
lr_save_string(lr_get_attrib_string("URL"),"TescURL";
137Sampath Velupula
Common Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
138/157
Web_reg_save_param Saves dynamic data information to a parameter:
web_reg_save_param(const char *ParamName,LB,RB,ORD,SaveLen,SaveOffset, LAST);
web_reg_save_param("tlight_name","LB=Select your departure",rtRB="U,LAST);
Web_reg_find
Registers a search for a text string for the next Action function:
Web_reg find("Text=Welcome", SaveCount, LAST);
web reg_find ("SaveCount=booked_count", "Text=our \n""itinerary has been
booked", LAST);
138Sampath Velupula
Command & Informational
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
139/157
139SAMPATH VELUPULA
Message and Runtime
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
140/157
140SAMPATH VELUPULA
String
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
141/157
141SAMPATH VELUPULA
Transactions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
142/157
142SAMPATH VELUPULA
Web Action and Search Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
143/157
143SAMPATH VELUPULA
Web Correlation and Header
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
144/157
144SAMPATH VELUPULA
Web Cookie, Authentication & Replay
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
145/157
145SAMPATH VELUPULA
Web Misc
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
146/157
146SAMPATH VELUPULA
Citrix Connection, Mouse, Keyboard
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
147/157
147SAMPATH VELUPULA
Citrix Selection & Synchronization
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
148/157
148SAMPATH VELUPULA
Citrix Informational & General
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
149/157
149SAMPATH VELUPULA
ANSI C in VuGen
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
150/157
Variable A variable is a named entity which may represent different values at different times.
Constant
A constant is a named entity which always represents the same value.
lr save datetime("Tomorrow is %B %d %Y", DATE NOW + ONE DAY,
"next ") ;
Another example:
if (event == GENERAL ERROR)
lr set transaction status(LR FAIL);
lr end transaction("tl", LR AUTO);
150Sampath Velupula
Branching Statement
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
151/157
151Sampath Velupula
Loop Statement
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
152/157
152Sampath Velupula
C Language Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
153/157
153SAMPATH VELUPULA
C Language Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
154/157
154SAMPATH VELUPULA
C Language Functions
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
155/157
155SAMPATH VELUPULA
Quiz
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
156/157
156SAMPATH VELUPULA
8/21/2019 IP-BBT-04 - LoadRunner (1) (1)
157/157
SAMPATHVELUPULA
THANKYOU