You are on page 1of 37

Creating Vusers:

CHECKPOINTS
http://cheyat.com/qa/loadrunne
r-online-training-tutorials

LRWEB6.5/03

Objectives
In this lesson you will learn:
Visual cues to check for during load testing
The importance of functional testing under load
The types of checks in VuGen
How to add verification checkpoints during
recording

The Business Process Works for


One User . . .
Process
complete!

the
Internet

Database Database
server
server

Web
Server

. . . But May Not Work for Many


Concurrent Users
Process
failed!

the
Internet

Database Database
server
server

Web
Server

Key Terms Used in This Course

Functional Testing
Under Load
Confirming that all business processes
complete properly while the server(s)
handle concurrent usage.

Which Visual Cues Confirm


Business Process Success?
EXAMPLE CASE
SCENARIOS

Web-based
bookseller

Order Entry
Intranet Site

Photo archive of
newspaper extranet

Where in the business


process might load
overwhelm the server(s)
and cause failure?

Search
Submit order

Inserting a
sales order

Image request

What visual cues in


the browser indicate
success?

Results page
instead of
error message

Order number
appears

Expected image
displayed

How Virtual Users Verify


Functionality
Virtual Users:
Store the expected value
Compare the actual value on the web page to the
expected value during playback
Report the comparison result (status),
either PASS or FAIL

Key Terms Used in This Course

Checkpoint
A step in the Vuser script which
verifies whether a visual cue
appeared as expected.

Types of Checks
Check
Image

Example usage
Did the news site
display the picture?

Determine Visual Cues to Verify

Same image
whenever page is
loaded . . .

Use image
check

LoadRunner Expert Workflow


Zooming In
Phase 1
Plan Load
Test

Phase 2
Create Web
Virtual Users

Phase 3
Create
Scenarios

Phase 4
Run
Scenarios

CREATE WEB VIRTUAL USERS


2.1 Record user actions
2.2 Add LoadRunner transactions
2.3 Parameterize data
2.4 Add verification checks
2.5 Verify correct execution

Phase 5
Analyze
System
Under Load

Tune
System Based
on Analysis

2.4 Add Verification Checks

Creating an Image Check


1. While recording,
get the image
name
a. In the browser,
right click on
image to be
checked
b. Select Save
Picture As
from pop-up
menu

2.4 Add Verification Checks

Creating an Image Check


c. Copy existing
file name using
Ctrl + C
d. Click Cancel

(logo.gif)

NOTE: If the file extension (.gif, .jpg, etc.) does not


appear, type it in the box yourself before copying

2.4 Add Verification Checks

Creating an Image Check


2. Add the step
a. Click the
Insert After
toolbar button

b. The Add Step dialog


opens
c. Select Image Check,
and click OK.
The Image Check
Properties dialog opens.

2.4 Add Verification Checks

Creating an Image Check


3. Paste the file name
into Image Check
Properties
a. Check the Image
server file name
(SRC attribute)
check box
b. Paste the file name
into the edit box
using Ctrl + V

2.4 Add Verification Checks

Creating an Image Check


4. Rename the step
a. Click the General tab
b. Change the Step
Name from default
Image Check to a
more descriptive
name
c. Click OK to finish

2.4 Add Verification Checks

Creating an Image Check


The image
check step
is displayed
in the Icon
Tree under
the page
where image
appears

Types of Checks
Check

Example usage

Image

Did the news site


display the picture?

Text

Did a search engine


return expected matches?

Determine Text Check Type to Use


TYPE

EXAMPLE

Checks for an exact match of


the visual cue

Plain text
Regular
expression
Number

DESCRIPTION

[a-z].*

Checks for a flexible range of


values
Checks for numeric values
defined in the check

Determine Text Check Type to Use

Type Type

Use plain text


Same static text
whenever page is
loaded . . .

2.4 Add Verification Checks

Plain Text Check With Boundaries

Determine Text Check Type to Use

[0-9].*
Order number
changes for every
transaction . . .

Use regular
expression

Key Terms Used in This Course

Regular Expression
A regular expression uses a wild card
to indicate a range of possible values.

Regular Expressions Explained

[]

[]

matches any character

welcome

welcomes
welcomed

matches any string of


characters

st*

start
stop

matches a range of
characters

[5-9]th

5th
7th

option [a-f]

option c
option d

[0-9]*

125
99431

matches any string of


characters in range

NOTE: For more information about regular expressions consult your LoadRunner documentation

2.4 Add Verification Checks

Regular Expression Check

2.4 Add Verification Checks

Checking a Visual Cue Generated


by a Parameter

Visual Cue may be:


robot
alien
How to
toucan
check
rabbit
depending on the input data

2.4 Add Verification Checks

Checking a Visual Cue Generated


by a Parameter
1. Add a text check to a
parameterized step
2. Click the ABC button
3. Select the steps
parameter from the list
and click OK
LoadRunner will
now check for the
value of the
parameter during
each iteration

Checking for an Error Page


Q: If you check for an error page and the error page
is found, should the Vuser pass?
A: No.

Q: So, how do you change a checks pass to a


fail and vice versa?

EXAMPLE

Modify Check Properties


1. Open Text Check Properties
dialog, General tab

2. Uncheck View only


the active properties
3. In the Expect row,
select NotFound
from Value list
4. Click the box to the
left of Expect

LoadRunner Expert Workflow


Zooming In
Phase 1
Plan Load
Test

Phase 2
Create Web
Virtual Users

Phase 3
Create
Scenarios

Phase 4
Run
Scenarios

CREATE WEB VIRTUAL USERS


2.1 Record user actions
2.2 Add LoadRunner transactions
2.3 Parameterize data
2.4 Add verification checks
2.5 Verify correct execution

Phase 5
Analyze
System
Under Load

Tune
System Based
on Analysis

Setup for Execution

Enable Checks in Run-Time Settings

NOTE: If a check was added


during recording, this setting
is automatically checked
after recording, you must
check the setting yourself

2.5 Verify Correct Execution

Check Mercury Test Results Window

PASSED EXAMPLE
Test Status = Passed
Check marks = Green

2.5 Verify Correct Execution

Check Mercury Test Results Window

FAILED EXAMPLE
Test Status = Failed
X marks = Red

2.5 Verify Correct


Execution

Check VuGen
Execution Log

PASSED EXAMPLE

2.5 Verify Correct


Execution

Check VuGen
Execution Log

FAILED EXAMPLE

Summary
Determine the visual cues you will check to verify
each business process
Add text and image checks during recording
Make sure that Enable verification checks is
checked in the Run-Time Settings, HTTP tab
before running the Vuser
LoadRunner compares a stored, expected value to
an actual value obtained during the run
The check status is always PASS or FAIL

Lab Exercise

You might also like