m2 developing vuser script

28
8/11/2019 M2 Developing Vuser Script http://slidepdf.com/reader/full/m2-developing-vuser-script 1/28 Copyright © 2007 Accenture All Rights Reserved 2.1: Developing Vuser Scripts Load Runner

Upload: patrick-cotton

Post on 03-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 1/28

Copyright © 2007 Accenture All Rights Reserved 

2.1: Developing Vuser Scripts

Load Runner

Page 2: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 2/28

  2Copyright © 2007Accenture All Rights Reserved 

Contents

• Load Testing  – Process

• Create Virtual Users Scripts

 – Plan the Vuser Scripts

 – Record the Vuser Scripts

• Viewing the Vuser Scripts

 –

Tree View – Script View

Page 3: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 3/28

  3Copyright © 2007Accenture All Rights Reserved 

Objectives

 At the end of the session, you will be able to:

• Understand Load Testing Process

• Learn to create Vuser Scripts

• Learn to Record and View Vuser Scripts

Page 4: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 4/28

  4Copyright © 2007Accenture All Rights Reserved 

Load Testing Process

Plan Load Test

Create Virtual Users Scripts

Create Scenarios

Execute Scenarios

 Analyze Results

Fine tune the System to re-runthe Scenario

• The First step in Load

Testing Process is

Planning the Test where

the Goals of Testing aredecided

• The next few slides are

about the second step

which involves Creating

Virtual User Scripts

Page 5: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 5/28

  5Copyright © 2007Accenture All Rights Reserved 

To Create Virtual Users Script

Following are the steps to create Vuser (VirtualUser) Script 

1. Plan the Script

• Collect the Test Information

2. Record the Script

3. Enhance the Script

– Transactions They are measurements of time elapsed in

the execution of one or more steps in a

business process– Verifications

This verifies content like text or images

on a web page 

Page 6: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 6/28

  6Copyright © 2007Accenture All Rights Reserved 

To Create Virtual Users Script

(continued)

– Parameters They are used to emulate multiple users having

different preferences in using an application

– Correlation

It is a process to save session ids in case ofapplications which maintain sessions to the

server so that Vuser uses the session ids while

running the Load Test.

It ensures emulation of real-life users during

Load Test

4.Test the Script

– Play back the script

– Verify if it passes

Page 7: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 7/28  7Copyright © 2007Accenture All Rights Reserved 

Plan Vuser Script

Planning for Vuser Scripts is the phase where theperformance requirements to Load Test are planned

• These performance requirements can be

 – Number of concurrent users

 – Response time for a business process

• Example

 – Planning performance requirements can be a web

application expected to have 1000 concurrent users

who should be able to download the home page by 0.5

seconds

Page 8: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 8/28  8Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

•To Record a script follow these steps

• Select Start  Programs  Mercury LoadRunner  

Applications  Virtual User Generator

Click on

 Virtual User

Generator

Page 9: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 9/28  9Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

•VuGen Start

Page is

displayed

•Click on New Vuser Script

to create a

new script

•The NewVirtual User

Dialog is

displayed

Click on

“New Vuser

Script”

Page 10: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 10/28  10Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

•The New Virtual Userdialog displays a

list of all available

protocols for the

single protocol

script

• Client communicates

with the server using

a language called as

the Protocol

•VuGen displays aSelect the protocol

 Web (HTTP/HTML)  OK

Select the

 protocol Web(HTTP/HTML)

Click on

“OK”

Page 11: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 11/28  11Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• An emptyscript isdisplayed asshown in thefigure

• Click on the

Recording link to viewthe recordingoptions

IntroductionPane

Task Pane Tool Bars

Click on “Recording”

Page 12: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 12/28  12Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• The illustrations tocreate the Vuser Script

in the next few slides

will use the Mercury

Tours Web site

• This web site offersonline booking for Air

Travel

• Click on Start

Recording to record the

Vuser Script

Click on Start Recording to

record the Vuser Script

Page 13: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 13/28  13Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

•Start Recording Dialog box is displayed

• Enter the URL of the web site

http://127.0.0.1:1080/mercurywebtours/

• Select the “Action” in Record To Action

• Click on Options to set the Recording Options

Application Type

Internet applications

Win32 applications

Program to Record

lists the Browsersor the InternetApplications torecord

Click on Options button

Select “Action”

option

Enter the URL of

the web site

Page 14: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 14/28  14Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• The Recording

Options Dialog boxis displayed

• Select the HTML based Script  

Click OK

URL based scriptis used

For Non browser

applications

HTML based script is used

For Internet applications

Select the HTML

based Script

Page 15: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 15/28  15Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• A floatingrecording

Toolbar is

displayed

• Log on toMercury Tours

Web Site

 – Member Name : 

jojo

 – Password : 

bean

• Click on Submit 

Indicates Recording

Log on to MercuryTours Web Site

Member Name : jojo

Password : bean

Click onSubmit

Page 16: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 16/28  16Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

•Home Page ofMercury Toursis displayed

•Click on the

Flights Buttonto book aFlight

Click on “Flights”Button

Page 17: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 17/28  17Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

•Find Flight isdisplayed

•Select theDeparture City

as “Denver” 

•Select theArrival City as“Los Angeles” 

•Click on theContinue Button

Select the

Departure City as

“Denver” 

Select the

Arrival City as

“Los Angeles” 

Click on the

“Continue” Button

Page 18: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 18/28

  18Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

Select the

Flight

Click on the

“Continue” Button 

• The list of

flights to

Denver and Los

Angeles are

displayed

• Select the

first option  

Click onContinue

T R d th V S i t

Page 19: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 19/28

  19Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• Enter the

Credit Card

number as

12345678

• Exp. date of

the card as

06/07 Click on

ContinueClick on the

“Continue” Button 

Enter the Exp.

Date as 06/07

Enter the Credit

Card Number as

12345678

Page 20: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 20/28

  20Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• Invoice of theflight reserved

is displayed

• The recording

of the Bookingof a flight is

completed at

this page

•Click on stoprecording

Click to Stop

Recording

Page 21: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 21/28

  21Copyright © 2007Accenture All Rights Reserved 

To Record the Vuser Script

(continued)

• The RecordingSummary is

displayed after

the recording

process

The tick mark hereindicates that the data wasgenerated successfully forthe Action during therecording process

The tick mark hereindicates that theWeb(HTTP/HTML) protocolwas detected and data wasgenerated successfully

Page 22: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 22/28

  22Copyright © 2007Accenture All Rights Reserved 

To View the Vuser Script

The Vuser Script can be viewed in two ways – Tree View

This displays Vuser script in an icon based format,

in which each step is represented by an icon

 – Script View

This is a text based view that lists the actions of the

viewer as Application Programming Interface

functions

Page 23: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 23/28

  23Copyright © 2007Accenture All Rights Reserved 

Tree View

• To view thescript in TreeView follow thesesteps

• Click on View Menu  Tree View

Select the “Tree View”

menu Option

Page 24: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 24/28

Page 25: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 25/28

  25Copyright © 2007Accenture All Rights Reserved 

Script View

•To view the scriptin Script View

follow these steps

• Click on View Menu

 Script ViewSelect the“Script

View” menu

Option

Page 26: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 26/28

  26Copyright © 2007Accenture All Rights Reserved 

Script View (Continued)

• Script View is split into two

parts. They are as follows: – List View

It shows operations duringthe recording process

– Vuser_init – Initialization of the

application– Action – Userinteraction with theapplication

– Vuser_end – Closing ofthe application

 –

 VuGen Editor  This displays the codeLoadRunner creates tosignify a recording action

This code is color codedto signify the differentfunctions in LoadRunner

VuGen Editor

Color Coded functions

Page 27: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 27/28

  27Copyright © 2007Accenture All Rights Reserved 

Key Points

• Creation of Vuser Scripts is a part of the Load Testing

process

• Recording the Vuser scripts involves recording the user

actions through a business process

• The script can be viewed by the Tree View and Script

View

Page 28: M2 Developing Vuser Script

8/11/2019 M2 Developing Vuser Script

http://slidepdf.com/reader/full/m2-developing-vuser-script 28/28

Questions and Comments