+ All Categories
Home > Documents > LoadRunner Tutorial - Best Computer Degree Courses...

LoadRunner Tutorial - Best Computer Degree Courses...

Date post: 14-May-2018
Category:
Upload: dangminh
View: 224 times
Download: 1 times
Share this document with a friend
73
1 LoadRunner Tutorial LoadRunner is a market-leading performance and load testing software that helps you predict behavior and performance of enterprise applications under controlled and peak load conditions.
Transcript
Page 1: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

1

LoadRunner Tutorial LoadRunner is a market-leading performance and load testing software that helps you predict behavior and performance of enterprise applications under controlled and peak load conditions.

Page 2: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

2

Contents Chapter 1: About This Book .......................................................................................................................... 4

1.1 Objectives............................................................................................................................................ 4

1.2 Introduction ........................................................................................................................................ 4

1.3 Contents .............................................................................................................................................. 4

Chapter 2: Getting Started ............................................................................................................................ 5

2.1 Why LoadRunner? ............................................................................................................................... 5

2.2 LoadRunner Components ................................................................................................................... 5

2.3 LoadRunner System Requirements ..................................................................................................... 6

Chapter 3: LoadRunner Installation .............................................................................................................. 8

Chapter 4: LoadRunner Basic ...................................................................................................................... 14

Chapter 5: HP Web Tours Application ........................................................................................................ 15

5.1 Opening HP Web Tours ..................................................................................................................... 15

Chapter 6: Building Script ........................................................................................................................... 19

6.1 Recording an Application .................................................................................................................. 19

6.2 Viewing the Script ............................................................................................................................. 30

Chapter 7: Playing Script ............................................................................................................................. 32

7.1 LoadRunner Script Runtime Settings ................................................................................................ 32

7.2 View the Script Running in Real Time ............................................................................................... 34

7.3 View Information About the Replay ................................................................................................. 36

7.4 Replay Log ......................................................................................................................................... 37

7.5 View Test Results .............................................................................................................................. 38

Chapter 8: Business Processes .................................................................................................................... 39

8.1 Observing Transaction Result ........................................................................................................... 41

Chapter 9: Parameterization ....................................................................................................................... 42

Page 3: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

3

9.1 Creating a Parameter ........................................................................................................................ 42

9.2 Deleting a Parameter ........................................................................................................................ 44

Chapter 10: Correlation in LoadRunner Scripts .......................................................................................... 45

10.1 Using Correlation in LoadRunner scripts ........................................................................................ 45

Chapter 11: LoadRunner Manual Scenario ................................................................................................. 50

11.1 Introduction of Scenario ................................................................................................................. 50

Chapter 12: LoadRunner Goal-Oriented Scenario ...................................................................................... 60

12.1 Goal-Oriented Scenario ................................................................................................................... 60

12.2 The Load Controller Window .......................................................................................................... 61

12.3 Define the Goal ............................................................................................................................... 62

12.4 Determine Load Behavior ............................................................................................................... 62

12.5 Run a Goal-Oriented Scenario ........................................................................................................ 64

Chapter 13: LoadRunner Analysis ............................................................................................................... 66

13.1 Creating Analysis Session ................................................................................................................ 66

13.2 Methods to open LoadRunner Analysis .......................................................................................... 66

13.3 Session Information ........................................................................................................................ 67

13.4 Analysis Reports .............................................................................................................................. 67

13.5 Analysis Graphs ............................................................................................................................... 70

13.6 Adding New Graph .......................................................................................................................... 72

Summary ................................................................................................................................................. 73

Page 4: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

4

Chapter 1: About This Book

1.1 Objectives This book gives an overview of load testing and familiarizes you with the LoadRunner testing environment.

1.2 Introduction LoadRunner is a market-leading performance and load testing software that helps you predict behavior and performance of enterprise applications under controlled and peak load conditions. To load test an application, LoadRunner emulates an environment with multiple users working concurrently. Under load condition, LoadRunner accurately measures, monitors, and analyzes a system’s performance and functionality. Let’s now learn about the purpose of using LoadRunner and its features.

1.3 Contents In this tutorial, you will learn about:

• LoadRunner Components and its system requirements • LoadRunner basics and its installation • Building and playing scripts • Business processes • Parameterization • Using correlation in LoadRunner scripts • LoadRunner manual scenario • LoadRunner goal oriented scenario • LoadRunner analysis

Page 5: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

5

Chapter 2: Getting Started

2.1 Why LoadRunner? Manual testing methods offer an incomplete solution for load testing where many users work simultaneously on a system. Although each user can work at a single machine and submit input to the system, manual testing is not preferable due to the following drawbacks:

• It is expensive, requiring large amounts of both personnel and machinery. • It is complicated, especially coordinating and synchronizing multiple testers. • It involves a high degree of organization, especially to record and analyze results

meaningfully. • The repeatability of the manual tests is limited.

LoadRunner addresses these drawbacks of manual testing. It cuts down the personnel requirements by substituting human users with virtual users, called Vusers. These Vusers emulate the behavior of real users—operating real applications. Since Vusers can run on a single computer, LoadRunner also reduces the hardware requirements.

LoadRunner also helps monitor the application performance online thereby enabling you to fine-tune your system during the test execution. It automatically records the performance of the application during a test. It offers a wide variety of graphs and reports to view the performance data.

Using LoadRunner, the network and server resources can be monitored to help you improve performance. Because LoadRunner tests are fully automated, you can easily repeat them as often as you need.

2.2 LoadRunner Components In this section, you’ll learn about the components of LoadRunner. The LoadRunner components are:

• The Virtual User Generator It captures end-user business processes and creates an automated performance testing script, also known as a virtual user script.

• The Controller

It organizes, drives, manages, and monitors the load test.

• The Load Generators It creates load by running virtual users.

• The Analysis

It helps you view, dissect, and compare the performance results.

• The Launcher It provides a single point of access for all of the LoadRunner components.

Page 6: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

6

2.3 LoadRunner System Requirements To install LoadRunner on your computer, you should meet the following system requirements:

System Requirement

• For installation of LoadRunner Controller, VuGen, and Analysis: LoadRunner Components and its system requirements

• LoadRunner basic and its installation • Building and playing script • Business processes • Parameterization • Using correlation in LoadRunner scripts • LoadRunner manual scenario • LoadRunner goal oriented scenario • LoadRunner analysis

Processor

• CPU Type: Intel Core, Pentium, AMD, or compatible • Speed: 1 GHz minimum; 2 GHz or higher recommended • Intel Hyper-Threading technology is not supported

Operating System

• Windows Vista SP1 • Windows XP Professional SP2 or SP3 • Windows Server 2003 Standard Edition/Enterprise Edition SP2 • Windows Server 2003 Standard Edition/Enterprise Edition R2 SP2

RAM

• Minimum: 512 MB • Recommended: 1 GB or higher

Screen Resolution

• Minimum: 1024 x 768

Browser

• Microsoft Internet Explorer 6.0 SP1 or SP2 • Microsoft Internet Explorer 7.0

Available Hard Disk Space

• Minimum 1.5 GB

Page 7: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

7

For installation of Load Generator

Processor

• CPU Type: Intel Core, Pentium, AMD, or compatible • Speed: 1 GHz minimum; 2 GHz or higher recommended • Intel Hyper-Threading technology is not supported

Operating System

• Windows Vista SP1 • Windows XP Professional SP2 or SP3 • Windows Server 2003 Standard • Edition/Enterprise Edition SP2 • Windows Server 2003 Standard • Edition/Enterprise Edition R2 SP2

RAM

• Minimum: 1 GB • Memory depends on protocol type and system under test and can vary greatly.

Browser

• Microsoft Internet Explorer 6.0 SP1 or SP2 • Microsoft Internet Explorer 7.0

Available Hard Disk Space

• Minimum 1 GB

Page 8: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

8

Chapter 3: LoadRunner Installation

In this section, you will learn how to install LoadRunner on your computer. 1. Run the setup.exe file in the root directory of the installation disk. LoadRunner installation splash screen is displayed.

• LoadRunner Full Setup This option allows you to install the main LoadRunner features and components including the Controller, the VuGen, Analysis, and the Load Generator.

• Load Generator This option allows you to install the components needed for running virtual users to generate load, and the MI Listener.

Page 9: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

9

2. You can choose to install the prerequisite software. Click OK and follow the on-screen instructions to install the listed software before continuing with the LoadRunner installation.

Note: If you click Cancel, the installer will exit because LoadRunner cannot be installed without the prerequisite software.

3. Review the license agreement.

To accept the terms of the license agreement, on the License Agreement screen, select I Agree, and then click Next.

Page 10: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

10

4. Register the LoadRunner installation on your computer.

On the Customer Information screen, in the Name box, enter your name and in the Organization box, enter the organization’s name, and then click Next. 5. Select a setup type (only for LoadRunner Full Setup).

On the Setup Type page, to install the complete set of LoadRunner features, select Complete. Alternatively, to install only those LoadRunner features that you choose to install, select Custom. Click Next to proceed.

Page 11: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

11

6. Select the features to install (only for Custom setup).

To perform a custom installation of LoadRunner, on the Custom Setup screen, select the LoadRunner features that you want to install and then click Next.

Note: By default, all the features are selected for installation. 7. Select the folder where you want to install the software.

• On the Select Installation Folder screen, in the Folder box, accept the default folder for the installation or browse to an alternate folder. Note: To check the disk space for each drive, you can click Disk Cost. The Disk Cost

Page 12: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

12

dialog box is displayed specifying the size, available space, and required space for each disk. To close the dialog box, you can click OK.

• Click Next to proceed.

8. Complete the installation process.

On the completion of installation, the Installation Complete screen is displayed confirming successful installation. Click Finish to proceed.

The LoadRunner Launcher opens displaying the LoadRunner License Information dialog box.

Page 13: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

13

You’ve successfully installed LoadRunner on your computer. To start LoadRunner, select Start > Programs > LoadRunner > LoadRunner. Select the application that you want to run from the LoadRunner launcher window.

Page 14: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

14

Chapter 4: LoadRunner Basic

Scenarios Using LoadRunner, your application performance testing requirements are divided into scenarios. A scenario is defined by the events that occur during each testing session. For example, a scenario defines and controls the number of users to emulate, the actions that they perform, and the machines on which they run their emulations. Vusers In the scenario, LoadRunner substitutes human users with virtual users or Vusers. When you run a scenario, 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. Interestingly, a scenario can contain tens, hundreds, or even thousands of Vusers.

Vuser Scripts The actions performed by a Vuser during the scenario are described in a Vuser script. When you run a scenario, each Vuser executes a Vuser script. The Vuser scripts include functions that measure and record the performance of your application’s components.

Transactions A transaction is an action or a set of actions that help you measure the performance of the server. You can define transactions within your Vuser script. To do so, you need to enclose the appropriate sections of the script with the start and end transaction statements.

Rendezvous Point To emulate heavy user load on the server, you can insert rendezvous points into Vuser scripts. Rendezvous points instruct Vusers to wait during test execution for multiple Vusers to arrive at a certain point, such that they may simultaneously perform a task. LoadRunner Controller To manage and maintain your scenarios, you can use the LoadRunner Controller. Using the Controller, you can control all the Vusers in a scenario from a single workstation. Load Generator When you execute a scenario, the LoadRunner Controller distributes each Vuser in the scenario to a machine called load generator. The load generator executes the Vuser script and enables the Vuser to emulate the actions of a human user.

Performance Analysis Vuser scripts include functions that help you measure and record system performance during load-testing sessions. During a scenario run, you can monitor the network and server resources. Following a scenario run, you can view performance analysis data in reports and graphs.

Page 15: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

15

Chapter 5: HP Web Tours Application

In this tutorial, we will use a sample application, HP Web Tours, to experience hands-on performance testing. HP Web Tours is a Web-based travel agency system. With this application, users can connect to a Web server, search for flights, book flights, and check flight itineraries. While LoadRunner supports over 40 types of applications, this tutorial demonstrates load testing Web-based applications. In this section, you will become familiar with the HP Web Tours application.

5.1 Opening HP Web Tours To familiarize with the HP Web Tours application, follow the steps given below: 1. Ensure that the sample Web server is running. After you install LoadRunner successfully and reboot your system, the Web server starts automatically. If it doesn’t, click Start > Programs > LoadRunner > Samples > Web > Start Web Server. Note: If you try to start the Web server while it is still running, an error message will be displayed. You can ignore the message and continue with the further steps. 2. Open the HP Web Tours application. To open the HP Web Tours application, click Start > Programs > LoadRunner > Samples > Web > HP Web Tours Application. A browser opens with the Mercury Tours opening page. 3. Log on to HP Web Tours.

Page 16: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

16

• On the login page, enter the following information: Username: jojo Password: bean

• Click Login to log in to HP Web Tours. Mercury Tours welcomes you to the application.

4. Reserve a flight.

• Click Flights in the left pane. The Find Flight page opens.

• On the Find Flight page, enter the following details:

o Departure City o Departure Date o Arrival City o Return Date o Seating Preference

• Accept the other default settings, and then click Continue.

The Search Results page opens.

Page 17: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

17

5. Select a flight.

Accept the default flight selection and click Continue. The Payment Details page opens. 6. Enter payment information and book flight.

• On the Payment Details page, in the Credit Card box and the Exp Date box, enter the credit card details. Click Continue. The Invoice page opens, displaying your invoice.

Page 18: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

18

7. Check the itinerary.

• Click Itinerary in the left pane. The Itinerary page displays all existing flight reservation records with all details.

8. To log off, click Sign Off in the left pane.

Page 19: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

19

Chapter 6: Building Script

6.1 Recording an Application The Virtual User Generator module of LoadRunner, also called as VuGen creates artificial users and records all our actions in the form of automated scripts. VuGen works on the principle of record and playback.

In this section, you will learn to record an application using VuGen Module. Follow the steps given below for recording:

1. Starting of the LoadRunner: To start LoadRunner, click Start > Programs > LoadRunner > LoadRunner. The LoadRunner launcher window is displayed.

2. Starting the VuGen Module of LoadRunner To start the VuGen Module, in the LoadRunner launcher window, on the Load Testing tab, click Create/Edit Scripts.

The Start Page of VuGen module is displayed.

Page 20: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

20

3. Creation of a New Script

To create a Vuser script, in the Start Page window, on the Scripts tab, click New Vuser Script.

The New Virtual User dialog box is displayed.

4. Choose single protocol script or multiple protocol script.

In the New Virtual User dialog box, you can select one of the following options:

Page 21: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

21

a. New Single Protocol Script Select this option if you want to make a selection from the Category list and select one of the protocols.

b. New Multiple Protocol Script Select this option to record more than one protocol in a single recording session. Then select the desired protocol from the Available Protocols list. Click the right-pointing arrow to move the selection into the Selected Protocols list. Repeat the step to select all the desired protocols.

5. Close the New Virtual User dialog box. To close the New Virtual User dialog box, click OK.

6. Start recording various events into the Vuser script. When a new script is created, the Start Recording dialog box opens automatically. Alternatively, on the toolbar at the top of the page, you can click the Start Record button.

Note: The Start Recording dialog box may appear a little different for different protocols.

7. Recording for the Windows-based application

In the Start Recording dialog box, choose the following options: a. Application type: Select Win32 Applications or Internet Applications, e.g. Web and Oracle NCA scripts record Internet Applications, while Windows Socket Vusers records a Win32 application.

b. Program to record: Enter the Win 32 application to record.

c. Program Arguments: Enter the command line arguments for the EXE file specified above; e.g. if we specify "abc32.exe" with the command line options "genius@xyz", it connects the user Genius to the server "xyz" when starting "abc32.exe".

Page 22: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

22

d. Working Directory: This information is needed for some specific applications requiring us to specify a working directory.

8. Recording for Internet Applications

In the Start Recording dialog box, choose the following options: a. Application type: Select Internet Applications. b. Program to record: Select the browser or Internet application to record. c. URL Address: Specify the starting URL address, for e.g., in the URL Address box, type http://localhost:1080/MercuryWebTours/. d. Working directory: Specify a working directory for some specific applications. This information may differ among different types of Vuser scripts. Enter the details of the program to record, the working directory, the Action & set the recording options by clicking “Options”.

Page 23: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

23

9. Record into Action box

Next, you select the section where you want to record. Options available are: vuser_init: It is used when recording a login to a server and it is executed when the Vuser is initialized. Actions: It is used when recording a client activity and it is executed when the Vuser is in Running status. vuser_end: It is used when recording a logoff procedure and it is executed when the Vuser finishes or is stopped. However, you can add a new section by clicking Actions > Create New Action and describe a new action name.

10. Recording the application startup Click Record the application startup. When you do not want VuGen to record the application startup, clear the check box.

11. Close the dialog box: Click OK to close the dialog box and start the recording. A new Web browser opens and displays the Mercury Tours site.

Page 24: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

24

12. Start the recording

a. On the login page of HP Web Tours, enter username as jojo and password bean, and then click Login.

A welcome page opens.

b. Enter the flight details.

On the welcome page, click Flights. The Find Flight page opens.

Page 25: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

25

c. On the Find Flight page, enter the following details:

• Departure City • Departure Date • Arrival City • Return Date • Seating Preference

Keep the rest of the default settings and click Continue. The Search Results page opens.

Page 26: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

26

d. Select a flight.

Click Continue to accept the default flight selections. The Payment Details page opens.

Page 27: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

27

e. On the Payment Details page, enter the payment information and book flight, and then click Continue.

The Invoice page opens, displaying your invoice.

Page 28: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

28

f. Check the itinerary.

On the Invoice page, click Itinerary in the left pane. The Itinerary page opens.

Page 29: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

29

g. To log off, click Sign Off in the left pane.

13. Complete the recording session.

a. Switch to the vuser_endsection in the floating toolbar.

b. On the Recording toolbar, click the Stop Recording button.

c. To save the recorded session, click Save.

Page 30: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

30

The Code Generation pop up window opens while the Vuser script is being generated.

The VuGen wizard then automatically proceeds to the next step in the task pane and displays the recording summary.

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

6.2 Viewing the Script

The steps you performed on the travel agent application by logging in, booking a flight, and logging off is recorded by VuGen from the moment you click the Start Record button until you click the Stop button. You can now view the script inside VuGen. The script can be viewed in Tree view or Script view. Tree view is an icon-based view that lists the actions of the Vuser as steps while Script view is a text-based view that lists the actions of the Vuser as functions.

Tree View

To view the script in Tree view, click View > Tree View. Alternatively, you can click the Tree View button. To view the Tree View across the whole window, remove the Task pane by clicking the Task button. For each step you perform during recording, VuGen generates an icon and a title in the test tree.

In Tree view, you can see the actions of the user as script steps. Most steps are accompanied by a corresponding snapshot of the recording. The snapshots make the scripts easier to understand, and easier to share between engineers because you can see exactly which screen was recorded during the recording process. Later, you can compare the snapshots to verify your script's accuracy. VuGen also creates snapshots of each step during replay.

Page 31: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

31

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, click View > Script View. Alternately, 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.

Page 32: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

32

Chapter 7: Playing Script

7.1 LoadRunner Script Runtime Settings After configuring load behavior, you will specify how your Vusers will behave during the test. When emulating a real user, you need to consider the user's actual behavior. Behavior refers to the time that a user takes to pause between actions, the number of times he repeats an action, and so on.

In this section, you will learn more about LoadRunner's run-time settings. 1. Open the Run-time Settings.

On the Design tab, select the script and click the Run-Time Settings button. The Run-Time settings are displayed.

The Run-Time settings let you emulate different kinds of user activity and behavior. They include: a. Run Logic

You can instruct a Vuser to Repeat the Run section when you run the script. Each repetition is known as an iteration.

b. Number of Iterations LoadRunner repeats all of the actions for the specified number of times. If you specify a scenario duration in the controller, the duration setting overrides the Vusers iteration settings.

Page 33: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

33

c. Pacing

This setting controls the time between iterations. The pace tells the Vuser how long to wait between iterations of Vuser. You can instruct Vuser by following any of the following methods:

1. As soon as the previous iteration ends 2. After the previous iteration ends with a fixed / random delay 3. At fixed / random intervals

d. Log Vusers log information about themselves and their communication between server. There are two types of logs:

• Standard • Extended

VuGen writes log messages that you can view in execution log.

Page 34: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

34

e. Think Time

When you run a Vuser script, the Vuser uses the think time values that were recorded into the script during the recording session. VuGen allows you to use the recorded think time, ignore it, or use a value related to the recorded time.

7.2 View the Script Running in Real Time VuGen’s run-time viewer feature displays the Vuser activities in real time as you playback the recorded script. By default, VuGen does not display an animation of the actions in your script and runs your test in the background. For this tutorial, however, you will instruct VuGen to display the actions in a viewer that lets you view each step that is executed by VuGen. The viewer is not an actual browser—it only displays snapshots of the pages that are returned to the Vuser.

Page 35: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

35

1. Click Tools > General Options > Display. 2. In the General Options dialog box, select the Show browser during replay and Auto arrange window check boxes. Clear Display report at the end of script execution check box. 3. To close the General Options dialog box, click OK. 4. In the task pane, click Verify Replay and then click the Start Replay button at the bottom of the instruction pane. Alternatively, you can press F5 or click the Run button on the toolbar. 5. If the Select Results Directory dialog box opens and ask you where you want to store the results directory, accept the default name and click OK. After a short while, VuGen opens a run-time viewer and begins running the script in either script view or tree view, depending on what you last had open. In the run-time viewer, you visually observe the Vuser’s actions. You can note how the replay is an exact playback of the steps you performed during recording.

Page 36: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

36

recording.

7.3 View Information About the Replay When the script stops running, you can view a summary of the replay in the wizard. To view the Last Replay Summary, in the task pane, click Verify Replay.

Run-time viewer

Page 37: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

37

The Last Replay Summary lists errors that may have been detected and also displays thumbnails of the Recording and Replay snapshots. The Last Replay Summary helps you compare snapshots and look for discrepancies between your recording and the replay. You can also look at the Vuser’s activity by reviewing a textual summary of the events. VuGen’s Replay Log tab in the Output window shows this color-coded information.

7.4 Replay Log In this section, you will learn how to open the replay log and locate some of the events and notifications. To view the replay log, follow the steps given below: 1. In the instruction pane, click the replay log hyperlink. Alternatively, you can click the Show/Hide output button in the toolbar or click View > Output Window from the menu. Then, click the Replay Log tab.

Page 38: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

38

7.5 View Test Results After you playback the events that you recorded, you can next view the results to see if everything succeeded. In this section, you will view and analyze the results of your script run. The results of the replay are displayed in the Test Results window. To view test results, follow the steps given below: 1. To return to the wizard, in the task pane, click Verify Replay. 2. In the instruction pane, under Verification, click the visual test results hyperlink. Alternatively, you can click View > Test Results. A new results window opens.

When the Test Results window first opens, it contains two panes: Tree pane (on the left) and Summary pane (on the right). The Tree pane contains the results tree. Each iteration is numbered. The Summary pane contains the details of the test. The top table indicates which iterations passed and which failed. The test is considered to have passed when VuGen’s Vuser successfully navigates through the HP Web Tours site according to the original recording. The bottom table indicates whether transactions and checkpoints passed or failed.

Page 39: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

39

Chapter 8: Business Processes When preparing an application for deployment, you are required to measure the duration of specific business processes—how long does it take to log in, book a flight, etc. These business processes are normally made up of one or more steps or actions within your script. In LoadRunner, you designate a series of actions you want to measure by marking them as transactions. Transaction helps to measure how long it takes to run a section of your test. A transaction represents the process in your application that you want to measure. In LoadRunner, you mark a series of actions as transactions. Your test must include transactions to be used by LoadRunner or the Business Process Monitor. LoadRunner and the Business Process Monitor use only the data that is included within a transaction, and ignore data in a test outside of a transaction. You define transactions within your test by enclosing the appropriate sections of the test with start and end transaction statements. During the test run, the StartTransaction step signals the beginning of the time measurement. The time measurement continues until the EndTransaction step is reached. The test report displays the time it took to perform the transaction. If you start a transaction while there is already an open transaction with the same name, the previous transaction is ended with Fail status and then the new transaction is started. You can add numerous transactions to your test; the count is unlimited. You can also insert a transaction within a transaction. You can insert a variety of transaction-related statements using the Step Generator or Expert View. You can also enter Start Transaction and End Transaction steps using options in the QuickTest window. Let’s learn how to insert a transaction. 1. Click the step where you want the transaction timing to begin. The page is displayed in the Active Screen tab. 2. Next, click the Start Transaction button or click Insert > Start Transaction. The Start Transaction dialog box opens. 3. Enter a meaningful name in the Name box. 4. Identify where you want the transaction timing to begin. To insert a transaction before the current step, select Before current step and to insert a transaction after the current step, select After current step. 5. Click OK. A Start Transaction step is added to the Keyword View.

Page 40: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

40

Now, let’s learn how to end transactions. During the test run, the End Transaction indicates the end of the time measurement. The end of a transaction is defined in the End Transaction dialog box.

1. Click the step where you want the transaction timing to end. The page opens in the Active Screen. 2. Click the End Transaction button or click Insert > End Transaction. The End Transaction dialog box opens. 3. The Name box contains a list of the transaction names you defined in the current test. Select the name of the transaction you want to end. 4. Identify where to insert the end of the transaction. To insert a transaction before the current step, select Before current step and to insert a transaction after the current step, select After current step.

Start Transaction

End Transaction

Page 41: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

41

5. Finally, click OK. An End Transaction step is added to the Keyword View.

8.1 Observing Transaction Result To observe the transaction result, go to Tree view by clicking View > Tree View. Alternately, in the toolbar, you can click the Tree view button. Notice how the Start Transaction and End Transaction markers have now been added to the tree as new steps at the precise points where you inserted them.

Page 42: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

42

Chapter 9: Parameterization

Parameterization is defined as the process that allows you to run the same script multiple times with different values.

Let’s learn how to create parameters.

9.1 Creating a Parameter 1. In the Parameter List dialog box, click the New button. 2. Next, enter a name for the new parameter, and then press Enter. 3. Set the parameter's type as File. Note: Other available parameter types are Date/Time, file, Group Name, Random number, Unique number, User defined function or Vuser ID (whichever is appropriate). 4. Next, you can add row or column and also you can delete row or column. 5. If table contains more than one column, then you can use option “select column” that have two options “by number” and “by name”. 6. Select next row: and provide method to select next row.

• Sequential • Random • Unique • Same line as <Pameter_Name>

7. To update values on:

• Each iteration - It instructs the Vuser to use a new value for each iteration • Each occurrence - It instructs the Vuser to use a new value for each occurrence of

the parameter • Once - It instructs the Vuser to update the value of the parameter only once during

the execution

Page 43: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

43

8. To close the Parameter List dialog box, click Close.

9. Next, switch to Script View, select the string, and right click on it. Then, “select the replace with parameter” get open.

10. In the Select or Create Parameter dialog box, in the Parameter name box, type the name of the parameter.

11. Then, click on OK.

Before you run your script, change the replay log setting. Make it the same number of value as you insert in the parameter list or by default it will run for only one iteration. Next, run the script. The replay log shows the parameter substitution that occurs for each iteration.

Page 44: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

44

When you run the load test, result of parameter is displayed in visual test result. Vusers will use the parameter values instead of the recorded value.

9.2 Deleting a Parameter 1. Select the parameter from the parameter tree, and click Delete. The Delete Parameter dialog box opens.

2. To delete the parameter file from the disk, select Delete parameter data file from disk.

3. Click Yes.

4. If you select Delete parameter data file from disk, VuGen sends a warning message. Click Yes to confirm your action.

Page 45: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

45

Chapter 10: Correlation in LoadRunner Scripts

10.1 Using Correlation in LoadRunner scripts Correlation is the key concept of LoadRunner. To become a LoadRunner professional, it is mandatory to have a full knowledge of correlation. After you create a script, you validate it by running it from VuGen. Sometimes, a simple playback could fail, even though the recording of the same actions succeeds. Many applications use dynamic values that change each time you use the application. When you replay a recorded session, the application creates a new session ID that differs from the recorded session ID. LoadRunner addresses this issue through correlation. Correlation saves the changing values, for example, the session ID, to a parameter. When running the emulation, the Vuser does not use the recorded value—instead, it uses the new session ID, assigned to it by the server. Mercury Tours for Playback Errors In this section, you will learn about an example of a common playback failure for which you need to modify a setting in the Mercury Tours application. This setting tells the Mercury Tours Web Server not to allow duplicate session IDs. 1. Open Mercury Tours Click Start > Programs > Mercury LoadRunner > Samples > Web > Mercury Web Tours Application. A browser opens with the Mercury Tours opening page. 2. Change the server options. Click the administration link on the Mercury Web Tours opening page. The Administration Page opens.

Page 46: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

46

3. On the Administration Page, select the third check box Set LOGIN form's action tag to an error page. Then, scroll down and click Update. 4. Next, scroll down to the bottom of the page and click the Return to the Mercury Tours Homepage link. Note: This setting tells the server not to allow duplicate session IDs. 5. Close the browser. For this, change the setting of Mercury Tours application. This setting tells the Mercury Tours Web Server not to allow duplicate session IDs. To address the common playback problems, following the steps given below: 1. Replay the script. Click Verify Replay in the Task pane and click the Start Replay button at the bottom of the instruction pane. VuGen runs the new script. Note: Several error messages are visible in the Replay Log tab in the output window, indicated by the red-colored text.

Page 47: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

47

2. View the Replay Summary To view the Last Replay Summary, in the task pane, click Verify Replay. 3. Next, click Scan the script for correlations. VuGen scans the script, searching for differences between the recorded values and the playbackvalues. VuGen displays a list of these differences that may require correlation in the Correlation Results tab in the output window.

Page 48: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

48

4. Correlate the Session ID. On the Correlation Results tab, select the first entry, and then click Correlate. VuGen inserts a new step at the top of the script that saves the original session ID to a parameter. In each replay session, VuGen saves the new unique session ID to a parameter. In the subsequent steps, it uses the saved value instead of the originally recorded value. Click View > Tree View to view this new step in the test tree.

5. Examine the syntax of the correlation statement. Click View > Script View to view the correlation statement in the script. The statement that VuGen added to the script looks like this: web_reg_save_param (“WCSParam_Diff1”, “LB=userSession value=”, “RB=>”, “Ord=1”, “RelFrameId=1.2.1”, “Search=Body”, LAST); This statement means “Check the server response for data located between the following two strings ” Left boundary userSession value= and right boundary >. Save the first occurrence of this data to a parameter called WCSParam_Diff1.” 6. Play the script again. To replay the script, click Vuser > Run. When the replay ends, click View > Tree View. Observe the Replay Log tab. Note that VuGen no longer issues the red-colored error messages. Right-click on the second step Service: Reg Save Param in the script and choose Go to step in Replay Log. VuGen places the cursor at the corresponding line in the replay log. The log indicates that function web_reg_save_param succeeded, indicating that the correlation worked. 7. Fix the server configuration. a. Reset the server to ignore unique session IDS. b. To open Mercury tours, click Start > Programs > Mercury LoadRunner > Samples >

Page 49: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

49

Web > Mercury Web Tours Application. c. On the Mercury Web Tours opening page, click the administration link. d. On the administration page, clear the third check box entitled: Set LOGIN form's action tag to an error page. e. Scroll down to the bottom of the page and click Update. f. Close the browser.

Page 50: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

50

Chapter 11: LoadRunner Manual Scenario

11.1 Introduction of Scenario A scenario is a file containing all the information about groups of Vusers through which you emulate a real-life user. When you run a scenario, the Vusers generate load on the server, and LoadRunner monitors the server and transaction performance. As discussed earlier, Load testing means testing your application under typical working conditions. In this section, you will learn to create a scenario that emulates the behavior of ten travel agents simultaneously logging on, searching flights, purchasing flights, checking itineraries, and logging off the system.

In this section, let us create a manual scenario, which will emulate various actions performed by a group of ten travel agents. The user actions can be simultaneously logging on to the system, searching various flights, buying the required flight tickets, checking itineraries, and finally logging off the system.

1. Run load tests. a. To open the HP LoadRunner Launcher window, click Start > Programs > LoadRunner > LoadRunner. b. To open the LoadRunner Controller, in the HP LoadRunner Launcher window, on the Load Testing tab, click Run Load Tests. The LoadRunner Controller opens with the New Scenario dialog box.

Page 51: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

51

2. Select a scenario type In the New Scenario dialog box, select Manual Scenario. 3. Add a script to the load test For the purpose of this tutorial, ask for a sample script from your instructor. The script is displayed in the Available Scripts section and in the Scripts in Scenario section. Click OK. The LoadRunner Controller opens your scenario in the Design tab.

4. Defining the group attributes for the script You should configure the Vuser groups in the Scenario Groups pane. Then, create different groups to represent typical users of your system and specify the number of Vusers that will run, and the machine that they will run on.

5. Service level agreement When you design a load test scenario, you can define goals or Service Level Agreements (SLAs) for the performance metrics. When you run the scenario, LoadRunner gathers and stores performance-related data. When you analyze the run, Analysis compares this data against the SLAs and determines SLA statuses for the defined measurements.

a. Locate the desired script Navigate to find out that our desired script (basic_script in this case) appears in the Group Name column of the Scenario Groups pane.

b. Change Scenario group name Select the script and click the Details button. The Group Information dialog box is displayed. In the dialog box, in the Group Name box, enter the group name. For example travel_agent, and then click OK to close the dialog box.

Page 52: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

52

The scenario settings are displayed in the Controller window.

c. Vusers Quantity Provide the desired number of Vusers intended to be created in the group. Click OK to display the name in the Scenario Groups pane under the Design tab. 5. Add a load generator or localhost a. To add a load generator to the scenario, click the Load Generators button in the Design view. The Load Generators dialog box is displayed.

Page 53: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

53

b. In the Load Generators dialog box, if the desired load generator does not appear in the list, select Add. The Add New Load Generator dialog box is displayed.

c. in the Add New Load Generator dialog box, in the Name box, enter the name of the load generator and in the Platform list, select the platform on which the load generator is running. d. To close the Add New Load Generator dialog box, click OK.

6. Test the Load Generator Connection When you run a scenario, the Controller connects to the load generators automatically. However, you can test the connections before trying to run a scenario. a. Select the localhost load generator and click Connect. b. When the connection is established, the status changes from Down to Ready. c. Click Close. 7. Schedule the scenario in the schedule pane of the Controller window In real-world scenario, actual users do not log on and off the system exactly at the same

Page 54: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

54

time. Here, we instruct the LoadRunner users to gradually log on and off the system by scheduling the scenario.

In the Scenario Schedule dialog box, under Schedule by, select the Scenario option and under Run Mode, select the Real-life schedule option.

8. Set the schedule actions definitions in Actions Grid.

In the Global Schedule actions grid, you should set the following four definitions: Initialize, Start Vusers, Duration, and End Vusers, one by one to launch the respective dialog boxes for defining the settings. 9. Initialize Vusers Initialization means preparing the Vusers and the load generators for a load test run by running the vuser_init action in the script. Initializing Vusers before they start running reduces CPU consumption and helps provide realistic results. To open the Edit Action dialog box, in the action grid, double-click Initialize. For this tutorial, in the dialog box, select the Initialize all Vusers simultaneously option.

Page 55: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

55

10. Start Vusersat specified Intervals Starting Vusers at intervals allows you to examine the gradual increase of Vuser load on the application under test over time, and helps you pinpoint exactly when the system response time slows down. To open the Edit Action dialog box, in the action grid, double-click Start Vusers. For this tutorial, in the dialog box, in the Start Vusers box, enter 8. Next, select the Vusers combo box and enter 2; select the time combo box and enter 30 seconds.

11. Specify Duration Through Interactive Schedule Graph, a duration is defined so that Vusers continue to perform the scheduled action for a specific period, thereby enabling you to measure the continuous load on the server. During the specified duration, the script will run as much iterations as possible irrespective of the number of iterations defined in the script’s run-time settings. In the action grid, click Duration or click the horizontal line representing the duration in the graph. The time line is highlighted and a dot and a diamond appear at its endpoints. Next, drag the diamond-shaped endpoint to set the desired time say 00:11:30. This implies that Vusers shall run for 10 minutes.

Page 56: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

56

12. Stop Vusers This process is done gradually. In the action grid, double-click Stop Vusers. The Edit Action dialog box will be displayed. For this tutorial, in the dialog box, in the Vusers combo box, enter 2, and in the time combo box, enter 30 seconds.

13. Configure the Run-time settings These settings help you define the behavior of the Vusers during the test. On the Design tab, click the Run-Time Settings button. Then select the desired script and modify the following run-time settings in the Run-Time Settings dialog box, if necessary. a. Run Logic: to define the number of times a user repeats a group of actions. b. Pacing: to define the time to wait before repeating an action. c. Log: to define the type of information needed to be captured during the test. d. Think Time: to define the time a user stops to think between steps. e. Speed Simulation: to define network connections such as modem, DSL or cable. f. Browser Emulation: to define different browsers. g. Content Check: for automatically detecting user-defined errors.

Page 57: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

57

14. Enable think time Select the General: Think Time node. Under Think Time options, select the Replay think time and Use random percentage of recorded think time options. For this tutorial, enter a minimum of 50% and a maximum of 150% think time.

15. Enable logging Select the General: Log node. Select the Enable logging check box. Under Log options, select the Always send messages option. Under Log messages at the detail level of, select the Extended log and Data returned by server options.

To close the Run-Time Settings dialog box, click OK. 16. Configure the Windows Resources Monitor You need to configure the Windows Resource monitor to view the performance of every single tier, server, and component of the application during the load test in real time.

Page 58: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

58

a. Open the Run view To open the run view, in the Controller window, click the Run tab. The Windows Resources graph is one of the four default graphs, which is displayed in the graph viewing area.

b. To open the Windows Resources dialog box, right-click the Windows Resources graph.

c. Selecting the monitored server In the Windows Resources dialog box, in the Monitored Server Machines section, click Add. The Add Machine dialog box opens.

Page 59: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

59

d. In the Name box, type localhost and in the Platform list, select the platform, for example, WIN2000. e. To close the Add Machine dialog box, click OK. f. Activate the monitor. To activate the monitor, in the Windows Resources dialog box, click OK. With these steps, the design of your Scenario gets complete and becomes ready for load testing.

Page 60: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

60

Chapter 12: LoadRunner Goal-Oriented Scenario

12.1 Goal-Oriented Scenario A goal-oriented scenario defines the goals you want your test to achieve, and LoadRunner automatically builds a scenario for you, based on these goals. The goal may be number of hits per second, number of transaction per second, etc. A goal-oriented scenario helps manage Vusers automatically to maintain and achieve the goal.

LoadRunner provides you with five different types of goals in a goal-oriented scenario: 1. Number of concurrent Vusers 2. Number of hits per second 3. Number of transactions per second 4. Number of pages per minute 5. Transaction response time that you want your scenario to reach These goal-oriented scenarios can be used in various situations. For example, if you know the total number of Vusers that can run your various business processes, you can prefer to use a Virtual Users goal type. If the strength of your server is known, then you can go for a Hits per Second, Pages per Minute, or Transactions per Second goal type. If you know the desired response time taken to complete a transaction, you can use a Transaction Response Time goal type. In the steps to follow, you will learn to create a goal-oriented scenario. 1. Create a new scenario To open the New Scenario dialog box, click File > New, or click New.

2. Select the scenario type.

Page 61: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

61

In the New Scenario dialog box, select Goal-Oriented Scenario. 3. Choose the script. a. From the Available Scripts list, select basic_script, and then click the Add button. The script is displayed in the Scripts in Scenario pane. b. Click OK. The LoadRunner Controller design view opens displaying the basic_script in the Script Name column.

12.2 The Load Controller Window The Controller window (goal-oriented) Design view contains two primary sections:

• Scenario Goal • Scenario Scripts

Scenario Goal The upper pane of the load controller window displays your testing goal, the number of users that you want to use to reach that goal, the scenario duration, and load behavior. You can define the goal settings from the Edit Scenario Goal dialog box. Scenario Scripts The lower pane of the load controller window helps you determine the Vuser scripts, their paths, the percentage of the total target assigned to each script, and the load generator machines. You can configure the scenario settings from here.

Page 62: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

62

12.3 Define the Goal In this section, you will learn to create a goal profile and define a scenario goal. 1. Open the Edit Scenario Goal dialog box. Click the Edit Scenario Goal button or select Scenario > Goal Definition. The Edit Scenario Goal dialog box opens.

2. Name the goal profile.

In the Edit Scenario Goal dialog box, click New. In the New Goal Profile dialog box, type the new goal profile name (for example, Hits per Second 3), and click OK. The new goal profile name appears in the selecton. 3. Define the scenario goal. a. In the Goal Type box, select Hits per Second. b. In the Reach Goal of X Hits per Second box, enter 3. 4. Set the minimum-maximum range of Vusers for LoadRunner to run. Enter 5 as the minimum and 10 as the maximum number of Vusers.

12.4 Determine Load Behavior After you define the test goal, you need to specify how and when you want the Controller to reach your target. Users do not log on and off the system at precisely the same time. To emulate real users, LoadRunner provides the capability in the Load Behavior tab for users to gradually log on and off the system. You also want the server to remain under the load for a period of time. The Scenario Settings tab in LoadRunner allows you to specify the time that

Page 63: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

63

the server remains under load. 1. Define load test behavior. In the Edit Scenario Goal dialog box, select the Load Behavior tab, and select Automatic. 2. Select the Scenario Settings tab.

Specify that the test should run for 5 minutes after the target has been achieved, and select Continue scenario without reaching goal. Once the load of three hits per second has been reached, the Controller keeps running the scenario for an additional five minutes, adding or subtracting Vusers as needed to keep the actual measurement within 6% of the specified target. This is to ensure that the server can sustain the load for a period of time. 3. Do not use recorded think time. In the lower-left corner of the Edit Scenario Goal dialog box, ensure that the Do not change recorded think time check box is cleared.

If you select this option, LoadRunner runs the scenario using the think time recorded in your script and you may need to increase the number of Vusers in your scenario in order to reach your target. 4. Close the Edit Scenario Goal dialog box. To close the Edit Scenario Goal dialog box, click OK.

The scenario target information you entered appears in the Scenario Goal window.

Page 64: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

64

After defining the test goal and load behavior, you can next configure the LoadRunner monitors. In this test, you should monitor the Hits per Second graph to follow the load that is generated on the server. You can monitor the Transaction Response Time graph to see what response times your customers will have when the server is under load. In addition, you can monitor the effect of load on the Throughput and Windows Resources graphs. To configure the Windows Resources monitor, follow the procedures in Chapter 11.

12.5 Run a Goal-Oriented Scenario In this section, you will learn to run your goal-oriented scenario and examine the test behavior. 1. Open the Controller window’s Run tab. Select the Run tab at the bottom of the screen.

You will observe that all the counters are at zero and the graphs are blank since the scenario has not run yet. When you start the scenario, the graphs and counters will begin to display information. 2. Specify a name for the Results directory. To open the Set Results Directory dialog box, click Results > Results Settings and enter a unique name for the result set. 3. Start the scenario. a. Click the Start Scenario button or click Scenario > Start. The Controller begins the scenario. Note: You will see that 5 Vusers are ramped up and they start running as LoadRunner attempts to generate the required goal of three hits per second. During the test, the Controller automatically starts and stops Vusers to maintain the given goal.

Page 65: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

65

4. Monitor the application under load The Running Vusers graph displays whole Scenario graph including Running, Ready, Finished, and Error.

The Transaction Response Time graph shows the amount of time it takes to navigate from one object to another.

In the Hits per Second graph, Hits is the number of requests sent by users. Hits per Second graph displays the number of hits (HTTPrequests) made to the Web server by Vusers during each second of the scenario run.

Page 66: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

66

Chapter 13: LoadRunner Analysis

LoadRunner Analysis provides graphs and reports to help you analyze the run, and pinpoint the problems that need to be eliminated to improve system performance.

13.1 Creating Analysis Session When you run a scenario, data is stored in a result file with a .lrr extension. Analysis is the utility that processes the collated result information and generates graphs and reports.

When you work within an Analysis session, the session contains at least one set of scenario results (lrr file). Analysis stores the display information and layout settings for the active graphs in a file with a .lra extension.

13.2 Methods to open LoadRunner Analysis

• Open Analysis directly from the controller (Results > Analyze Results)

Start > Programs > Mercury LoadRunner > Applications > Analysis.

Start > Programs > Mercury LoadRunner > LoadRunner, select the Load Testing or Tuning tab, and then click Analyze Load Tests or Analyze Tuning Sessions.

• You can also instruct controller to open analysis automatically after the Scenario execution by selecting Results > Auto Analysis.

• You can collate manually by selecting Results > Collate Results. • If your results are not collated, Analysis will automatically collate the results before

generating the analysis data.

Page 67: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

67

13.3 Session Information The Session Information dialog box displays the properties of the current Analysis session.

13.4 Analysis Reports Analysis provides various reports. Let’s understand the analysis reports in more detail.

Transaction report Transaction reports provide performance information about the transactions defined within the Vuser scripts. These reports give you a statistical breakdown of your results and allow you to print and export the data.

Transaction Reports are divided into the following categories:

• Activity • Performance

Activity reports provide information about the number of Vusers and the number of transactions executed during the scenario run. The available Activity reports are Scenario Execution, Failed Transaction, and Failed Vusers.

Performance reports analyze Vuser performance and transaction times. The available Performance reports are Data Point, Detailed Transaction, and Transaction Performance by Vuser.

Summary report The Summary report provides general information about the scenario run. You can view the Summary report at any time from the Analysis window.

Page 68: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

68

HTML report You can instruct Analysis to create an HTML report. Analysis creates an HTML report for each one of the open graphs.

Microsoft Word report 1. Select Reports menu, click Microsoft Word Report. The Microsoft Word Report dialog box opens.

2. In the Microsoft Word Report dialog box, in the Report title box, enter a report title. 3. In the Microsoft Word Report dialog box, enter other details like author’s name, job title, and the company’s name.

Page 69: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

69

4. By default, the report will be built with a title page, table of contents, graph details and descriptions, and measurement descriptions. 5. In the Company logo area, select Include company logo, and click browse to find the logo file path. Note that this must be a .bmp file. 6. Enter a location to save your report.

Crystal report To view the crystal report, select Reports menu, choose Crystal Report. It shows two options:

• Activity report • Performances report

Scenario execution report To view the scenario execution report, click the Reports menu > Crystal Report > Activity Report > Scenario Execution Report.

Page 70: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

70

Details Transaction (by vuser) report To view the Details Transaction report, click the Reports menu > Crystal Report> Performances Report > Details Transaction (by vuser) Report.

13.5 Analysis Graphs Analysis graphs are divided into the following categories:

Graph type Description Vuser Graphs Provide information about Vuser states and

other Vuser statistics. Error Graphs Provide information about the errors that

Page 71: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

71

occurred during the scenario. Transaction Graphs Provide information about transaction

performance and response time. Web Resource Graphs Provide information about the throughput,

hits per second, HTTP responses per second, number of retries per second, and downloaded pages per second for Web Vusers.

Web Page Breakdown Graphs Provide information about the size and download time of each Web page component.

User-Defined Data Point Graphs Provide information about the custom data points that were gathered by the online monitor.

System Resource Graphs Provide statistics relating to the system resources that were monitored during the scenario using the online monitor.

Network Monitor Graphs Provide information about the network delays.

Firewall Server Monitor Graphs - Provide information about firewall server resource usage.

Web Server Resource Graphs Provide information about the resource usage for the Apache, iPlanet/Netscape, iPlanet(SNMP), and MS IIS Web servers.

Web Application Server Resource Graphs - Provide information about the resource usage for various Web application servers.

Database Server Resource Graphs Provide information about database resources.

Streaming Media Graphs Provide information about resource usage of streaming media.

ERP/CRM Server Resource Graphs Provide information about ERP/CRM server resource usage.

Java Performance Graphs Provide information about resource usage of Java-based applications.

Application Component Graphs Provide information about resource usage of the Microsoft COM+ server and the Microsoft NET CLR server.

Application Deployment Solutions Graphs Provide information about resource usage of the Citrix MetaFrame and 1.8 servers.

Middleware Performance Graphs Provide information about resource usage of the Tuxedo and IBM WebSphere MQ servers.

Security Graphs Provide information about simulated attacks on the server using the Distributed Denial of Service graph.

Application Traffic Management Graphs Provide information about resource usage of the F5 BIG-IP server.

Infrastructure Resources Graphs Provide information about resource usage of FTP, POP3, SMTP, IMAP, and DNS Vusers on the network client.

Siebel Diagnostics Graphs Provide detailed breakdown diagnostics for transactions generated on Siebel Web,

Page 72: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

72

Siebel App, and Siebel Database servers. Siebel DB Diagnostics Graphs Provide detailed breakdown diagnostics for

SQLs generated by transactions on the Siebel system.

Oracle Diagnostics Graphs Provide detailed breakdown diagnostics for SQLs generated by transactions on the Oracle NCA system.

J2EE Diagnostics Graphs Provide information to trace, time, and troubleshoot individual transactions through J2EE Web, application, and database servers.

13.6 Adding New Graph To add a graph, click Graph > Add Graph, or click <New Graph>.

Graphs that contain data are listed in blue. By default, only graphs that contain data are listed. To view the entire list of LoadRunner graphs, clear Display only graphs containing data check box. Use the Scenario Elapsed Time field to limit the time range for which graph data is displayed.

Filtering and Sorting Graph Data

You can filter and sort data that is displayed in a graph. You sort and filter graph data using the same dialog box.

Filtering graph data

• You can filter graph data to show fewer transactions for a specific segment of the scenario.

• More specifically, you can display four transactions beginning from five minutes into the scenario and ending three minutes before the end of the scenario.

• You can filter for a single graph, in all graphs in a scenario, or in the summary graph.

Sorting Graph Data

• You can sort graph data to show the data in more relevant ways.

For example, transaction graphs can be grouped by the Transaction End Status, and Vuser graphs can be grouped by Scenario Elapsed Time, Vuser End Status, Vuser Status, and VuserID.

Page 73: LoadRunner Tutorial - Best Computer Degree Courses ...saintangelos.com/studentdesk/Download/STP_Loadrunner_Handout.pdf · LoadRunner Tutorial LoadRunner is a market-leading performance

73

Summary LoadRunner is a Mercury Interactive Tool that predicts performance and behavior of the system. To test the application, LoadRunner emulates an environment where multiple users work concurrently. While the application is under load, LoadRunner accurately measures and analyzes the system performance, and its functionality. In this tutorial, you learned about:

• LoadRunner Components and its system requirements

• LoadRunner basic and its installation

• Building and playing script

• Business processes

• Parameterization

• Using correlation in LoadRunner scripts

• LoadRunner manual scenario

• LoadRunner goal oriented scenario

• LoadRunner analysis


Recommended