Upload
jilani-shaik
View
128
Download
1
Embed Size (px)
Citation preview
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 . . .
Web Server
Process complete!
Database server
Database server
theInternet
. . . But May Not Work for Many Concurrent Users
Web Server
Database server
Database server
theInternet
Process failed!
Key Terms Used in This Course
Confirming that all business processescomplete properly while the server(s) handle concurrent usage.
Functional Testing Under Load
Which Visual Cues Confirm Business Process Success?
Where in the business process might load overwhelm the server(s) and cause failure?
What visual cues in the browser indicate success?
Web-based bookseller
Photo archive of newspaper extranet
• Search• Submit order
Results page instead of error message
Image request
Expected image displayed
Order Entry Intranet Site
Inserting a sales order
Order number appears
EXAMPLE CASE SCENARIOS
How Virtual Users Verify FunctionalityVirtual Users:
• Compare the actual value on the web page to the expected value during playback
• Report the comparison result (status), either PASS or FAIL
• Store the expected value
Key Terms Used in This Course
A step in the Vuser script which verifies whether a visual cue appeared as expected.
Checkpoint
LoadRunner Expert Workflow“Zooming In”
TuneSystem Based
on Analysis
Analyze System Under Load
Run Scenarios
Create Scenarios
Create Web Virtual Users
Phase 1
Plan Load Test
Phase 2 Phase 3 Phase 4 Phase 5
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
2.4 Add Verification ChecksCreating an Image Check
a. In the browser, right click on image to be checked
b. Select “Save Picture As…” from pop-up menu
1. While recording, get the image name
2.4 Add Verification ChecksCreating an Image Check
(logo.gif)
c. Copy existing file name using Ctrl + C
d. Click Cancel
NOTE: If the file extension (.gif, .jpg, etc.) does not appear, type it in the box yourself before copying
a. Click the Insert After toolbar button
2.4 Add Verification ChecksCreating an Image Check
c. Select Image Check, and click OK.
b. The Add Step dialog opens
2. Add the step
The Image Check Properties dialog opens.
a. Check the Image server file name (SRC attribute) check box
2.4 Add Verification ChecksCreating an Image Check
b. Paste the file name into the edit box using Ctrl + V
3. Paste the file name into Image Check Properties
2.4 Add Verification ChecksCreating an Image Check
a. Click the General tabb. Change the Step
Name from default “Image Check” to a more descriptive name
c. Click OK to finish
4. Rename the step
2.4 Add Verification ChecksCreating an Image Check
The image check step is displayed in the Icon Tree under the page where image appears
Did a search enginereturn expected matches?
Types of Checks
Example usageCheck
Did the news site display the picture?
Image
Text
Determine Text Check Type to Use
DESCRIPTION
Checks for numeric values defined in the check
Number 9Checks for a flexible range of values
Regular expression [a-z].*
Checks for an exact match of the visual cue
Plain text
TYPE EXAMPLE
Determine Text Check Type to Use
Same static text whenever page is
loaded . . .
Use plain text
Type Type
Determine Text Check Type to Use
Order number changes for every
transaction . . .
Use regular expression
[0-9].*
Key Terms Used in This Course
A regular expression uses a wild card to indicate a range of possible values.
Regular Expression
Regular Expressions Explained
st* startstop
matches any string of characters
[0-9]* 12599431
matches any string of characters in range
[ ]
[5-9]th 5th7th
matches a range of characters
[ ]
option [a-f] option coption d
welcome welcomeswelcomed
matches any character
NOTE: For more information about regular expressions consult your LoadRunner documentation
2.4 Add Verification ChecksChecking a Visual Cue Generated by a Parameter
Visual Cue may be:• robot• alien• toucan• rabbit
depending on the input data
How tocheck ?
2.4 Add Verification ChecksChecking a Visual Cue Generated by a Parameter1. Add a text check to a
parameterized step2. Click the ABC button3. Select the step’s
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 check’s pass to a fail and vice versa?
Modify Check Properties1. 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
EXAMPLE
LoadRunner Expert Workflow“Zooming In”
TuneSystem Based
on Analysis
Analyze System Under Load
Run Scenarios
Create Scenarios
Create Web Virtual Users
Phase 1
Plan Load Test
Phase 2 Phase 3 Phase 4 Phase 5
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
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 ExecutionCheck Mercury Test Results Window
PASSED EXAMPLETest Status = PassedCheck marks = Green
2.5 Verify Correct ExecutionCheck Mercury Test Results Window
FAILED EXAMPLETest Status = FailedX marks = Red
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