building scripts for hp loadrunner...

21
Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<< <<<<<<

Upload: prudence-shields

Post on 01-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Building Scripts

For HP LoadRunner

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 2: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Building Scripts

Introducing the Virtual User Generator (VuGen) The VuGen Window at a Glance Developing a Vuser Script Example- HP WebTours Website Tree View and Script View

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 3: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Introducing the Virtual User Generator (VuGen)

HP’s tool for creating Vuser scripts is the Virtual User Generator, VuGen.

During recording VuGen monitors the client end of the database and traces all the requests sent by the user and received from the user, to the server.

During playback, Vuser scripts communicate directly with the server by executing calls to the server API.

When a Vuser communicates directly with a server, system resources are not required for the client interface. This allows a large number of Vusers to run simultaneously on a single workstation, and few testing machines are required to emulate large server loads.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 4: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

The VuGen Window at a Glance

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 5: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Developing a Vuser script

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 6: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Recording Options

HTML based: Records script for every user action that is performed during recording

URL based: Records each and every browser request to the server and resources received from the server.

HTML mode is recommended for browser applications while URL mode is recommended for non-browser applications.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 7: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Start Recording

Application Type: Internet Application type for

web based applications e.g. Web/Oracle NCA.

Win32 Application type for non-Internet Applications e.g. Windows Socket.

Program to record: Select the browser or Internet application to record.

URL Address: Specify the application URL address.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 8: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Start Recording

Script consists of 3 sections…

Vuser_init( ): Login to server

Actions: Clients activities

Vuser_end( ): Logoff

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 9: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

User Actions

Logon(recordingoptional)

vuser_init.c

User Actions(Business Processes)

Action1.c, Action2.c, etc.(e.g., Create Order, Ship Order)

This section may be iterated (repeated) during one test run

Logoff(recordingoptional)

vuser_end.c

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 10: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Recording Script

Provide the URL of the application and navigate through the scenario that is to be tested.

The script is automatically recorded in VuGen.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 11: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

Open the Start Recording dialog box.

In the URL address box, type http://localhost:1080/WebTours.

In the Record into Action box, select Action.

Click OK.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 12: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

Log on to the HP Web Tours Website.

For the User Name enter “jojo” and for the Password enter “bean”. Click Login.

A welcome page opens.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 13: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

Click Flights and provide the following information:

Departure City: Denver (default)

Departure Date: Keep the default, current date

Arrival City: Los Angeles Return Date: Keep the

default, tomorrow’s date Seating Preference: Aisle

Keep the rest of the default settings and click Continue.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 14: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

The Search Results page opens.

Select a flight: Click Continue to accept the

default flight selections. The Payment Details page opens.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 15: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

Enter payment information and book flight: Enter 12345678 in the

Credit Card box and type 06/10 in the Exp Date box.

Click Continue.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 16: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

The Invoice page opens, displaying your invoice.

Check the itinerary: Click Itinerary in the left

pane.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 17: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

The Itinerary page opens. Click Sign Off in the left pane. Click Stop on the floating

toolbar to stop the recording process.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 18: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Example- HP Web Tours Website

The Code Generation pop up window opens while the Vuser script is generated and recording summary is displayed.

The recording summary includes the protocol information and a list of the actions created during the session. For each step you performed during recording, VuGen generated a snapshot, a picture of the window during recording.

Select File > Save or click the Save button.

Type basic_tutorial in the File name box and click Save.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 19: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Viewing the script – Script View

Script view is a text-based view that lists the actions of the Vuser as API functions.

To view the script in Script view select View > Script View or click the Script View button.

In Script view, VuGen shows the script in an editor with color coded functions and their argument values.

You can type C or LoadRunner API functions, as well as control flow statements, directly into this window.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 20: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Create script for HP WebTours application using HTML based recording mode.

Create script for HP WebTours application using URL based recording modes.

How does Protocol Advisor works? Analyze WebTours application using Protocol advisor?

Create script for HP WebTours application using different actions for login, transactions and logout.

Questions - To Review Your Skills

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Page 21: Building Scripts For HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>

Thank You

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<