LoadRunner Tutorial - Thane

2y ago
11 Views
2 Downloads
2.36 MB
73 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Sutton Moon
Transcription

LoadRunner TutorialLoadRunner is a market-leading performance and load testingsoftware that helps you predict behavior and performance ofenterprise applications under controlled and peak loadconditions.1

ContentsChapter 1: About This Book . 41.1 Objectives. 41.2 Introduction . 41.3 Contents . 4Chapter 2: Getting Started . 52.1 Why LoadRunner? . 52.2 LoadRunner Components . 52.3 LoadRunner System Requirements. 6Chapter 3: LoadRunner Installation . 8Chapter 4: LoadRunner Basic . 14Chapter 5: HP Web Tours Application . 155.1 Opening HP Web Tours . 15Chapter 6: Building Script . 196.1 Recording an Application . 196.2 Viewing the Script . 30Chapter 7: Playing Script . 327.1 LoadRunner Script Runtime Settings . 327.2 View the Script Running in Real Time . 347.3 View Information About the Replay . 367.4 Replay Log . 377.5 View Test Results . 38Chapter 8: Business Processes . 398.1 Observing Transaction Result . 41Chapter 9: Parameterization . 422

9.1 Creating a Parameter . 429.2 Deleting a Parameter . 44Chapter 10: Correlation in LoadRunner Scripts . 4510.1 Using Correlation in LoadRunner scripts . 45Chapter 11: LoadRunner Manual Scenario . 5011.1 Introduction of Scenario . 50Chapter 12: LoadRunner Goal-Oriented Scenario . 6012.1 Goal-Oriented Scenario. 6012.2 The Load Controller Window . 6112.3 Define the Goal . 6212.4 Determine Load Behavior . 6212.5 Run a Goal-Oriented Scenario . 64Chapter 13: LoadRunner Analysis . 6613.1 Creating Analysis Session . 6613.2 Methods to open LoadRunner Analysis . 6613.3 Session Information . 6713.4 Analysis Reports . 6713.5 Analysis Graphs . 7013.6 Adding New Graph . 72Summary . 733

Chapter 1: About This Book1.1 ObjectivesThis book gives an overview of load testing and familiarizes you with the LoadRunner testingenvironment.1.2 IntroductionLoadRunner is a market-leading performance and load testing software that helps youpredict behavior and performance of enterprise applications under controlled and peak loadconditions. To load test an application, LoadRunner emulates an environment with multipleusers 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 ContentsIn this tutorial, you will learn about: LoadRunner Components and its system requirementsLoadRunner basics and its installationBuilding and playing scriptsBusiness processesParameterizationUsing correlation in LoadRunner scriptsLoadRunner manual scenarioLoadRunner goal oriented scenarioLoadRunner analysis4

Chapter 2: Getting Started2.1 Why LoadRunner?Manual testing methods offer an incomplete solution for load testing where many userswork simultaneously on a system. Although each user can work at a single machine andsubmit input to the system, manual testing is not preferable due to the followingdrawbacks: 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 resultsmeaningfully. The repeatability of the manual tests is limited.LoadRunner addresses these drawbacks of manual testing. It cuts down the personnelrequirements by substituting human users with virtual users, called Vusers. These Vusersemulate the behavior of real users—operating real applications. Since Vusers can run on asingle computer, LoadRunner also reduces the hardware requirements.LoadRunner also helps monitor the application performance online thereby enabling you tofine-tune your system during the test execution. It automatically records the performance ofthe application during a test. It offers a wide variety of graphs and reports to view theperformance data.Using LoadRunner, the network and server resources can be monitored to help you improveperformance. Because LoadRunner tests are fully automated, you can easily repeat them asoften as you need.2.2 LoadRunner ComponentsIn this section, you’ll learn about the components of LoadRunner.The LoadRunner components are: The Virtual User GeneratorIt captures end-user business processes and creates an automated performancetesting script, also known as a virtual user script. The ControllerIt organizes, drives, manages, and monitors the load test. The Load GeneratorsIt creates load by running virtual users. The AnalysisIt helps you view, dissect, and compare the performance results. The LauncherIt provides a single point of access for all of the LoadRunner components.5

2.3 LoadRunner System RequirementsTo install LoadRunner on your computer, you should meet the following systemrequirements:System Requirement For installation of LoadRunner Controller, VuGen, and Analysis: LoadRunnerComponents and its system requirementsLoadRunner basic and its installationBuilding and playing scriptBusiness processesParameterizationUsing correlation in LoadRunner scriptsLoadRunner manual scenarioLoadRunner goal oriented scenarioLoadRunner analysisProcessor CPU Type: Intel Core, Pentium, AMD, or compatibleSpeed: 1 GHz minimum; 2 GHz or higher recommendedIntel Hyper-Threading technology is not supportedOperating System WindowsWindowsWindowsWindowsVista SP1XP Professional SP2 or SP3Server 2003 Standard Edition/Enterprise Edition SP2Server 2003 Standard Edition/Enterprise Edition R2 SP2RAM Minimum: 512 MBRecommended: 1 GB or higherScreen Resolution Minimum: 1024 x 768Browser Microsoft Internet Explorer 6.0 SP1 or SP2Microsoft Internet Explorer 7.0Available Hard Disk Space Minimum 1.5 GB6

For installation of Load GeneratorProcessor CPU Type: Intel Core, Pentium, AMD, or compatibleSpeed: 1 GHz minimum; 2 GHz or higher recommendedIntel Hyper-Threading technology is not supportedOperating System Windows Vista SP1Windows XP Professional SP2 or SP3Windows Server 2003 StandardEdition/Enterprise Edition SP2Windows Server 2003 StandardEdition/Enterprise Edition R2 SP2RAM Minimum: 1 GBMemory depends on protocol type and system under test and can vary greatly.Browser Microsoft Internet Explorer 6.0 SP1 or SP2Microsoft Internet Explorer 7.0Available Hard Disk Space Minimum 1 GB7

Chapter 3: LoadRunner InstallationIn 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 SetupThis option allows you to install the main LoadRunner features and componentsincluding the Controller, the VuGen, Analysis, and the Load Generator.Load GeneratorThis option allows you to install the components needed for running virtual users togenerate load, and the MI Listener.8

2. You can choose to install the prerequisite software. Click OK and follow the on-screeninstructions to install the listed software before continuing with the LoadRunner installation.Note: If you click Cancel, the installer will exit because LoadRunner cannot be installedwithout the prerequisite software.3. Review the license agreement.To accept the terms of the license agreement, on the License Agreement screen, select IAgree, and then click Next.9

4. Register the LoadRunner installation on your computer.On the Customer Information screen, in the Name box, enter your name and in theOrganization 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, selectComplete. Alternatively, to install only those LoadRunner features that you choose toinstall, select Custom. Click Next to proceed.10

6. Select the features to install (only for Custom setup).To perform a custom installation of LoadRunner, on the Custom Setup screen, select theLoadRunner 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 defaultfolder 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 Cost11

dialog box is displayed specifying the size, available space, and required space foreach 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 confirmingsuccessful installation. Click Finish to proceed.The LoadRunner Launcher opens displaying the LoadRunner License Information dialog box.12

You’ve successfully installed LoadRunner on your computer. To start LoadRunner, selectStart Programs LoadRunner LoadRunner. Select the application that you want torun from the LoadRunner launcher window.13

Chapter 4: LoadRunner BasicScenariosUsing LoadRunner, your application performance testing requirements are divided intoscenarios. A scenario is defined by the events that occur during each testing session. Forexample, a scenario defines and controls the number of users to emulate, the actions mulations.VusersIn the scenario, LoadRunner substitutes human users with virtual users or Vusers. Whenyou run a scenario, Vusers emulate the actions of human users working with yourapplication. While a workstation accommodates only a single human user, many Vusers canrun concurrently on a single workstation. Interestingly, a scenario can contain tens,hundreds, or even thousands of Vusers.Vuser ScriptsThe actions performed by a Vuser during the scenario are described in a Vuser script. Whenyou run a scenario, each Vuser executes a Vuser script. The Vuser scripts include functionsthat measure and record the performance of your application’s components.TransactionsA transaction is an action or a set of actions that help you measure the performance of theserver. You can define transactions within your Vuser script. To do so, you need to enclosethe appropriate sections of the script with the start and end transaction statements.Rendezvous PointTo emulate heavy user load on the server, you can insert rendezvous points into Vuserscripts. Rendezvous points instruct Vusers to wait during test execution for multiple Vusersto arrive at a certain point, such that they may simultaneously perform a task.LoadRunner ControllerTo manage and maintain your scenarios, you can use the LoadRunner Controller. Using theController, you can control all the Vusers in a scenario from a single workstation.Load GeneratorWhen you execute a scenario, the LoadRunner Controller distributes each Vuser in thescenario to a machine called load generator. The load generator executes the Vuser scriptand enables the Vuser to emulate the actions of a human user.Performance AnalysisVuser scripts include functions that help you measure and record system performanceduring load-testing sessions. During a scenario run, you can monitor the network and serverresources. Following a scenario run, you can view performance analysis data in reports andgraphs.14

Chapter 5: HP Web Tours ApplicationIn this tutorial, we will use a sample application, HP Web Tours, to experience hands-onperformance testing. HP Web Tours is a Web-based travel agency system. With thisapplication, users can connect to a Web server, search for flights, book flights, and checkflight itineraries. While LoadRunner supports over 40 types of applications, this tutorialdemonstrates load testing Web-based applications.In this section, you will become familiar with the HP Web Tours application.5.1 Opening HP Web ToursTo 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 startsautomatically. 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 bedisplayed. 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.15

On the login page, enter the following information:Username: jojoPassword: beanClick 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:ooooo Departure CityDeparture DateArrival CityReturn DateSeating PreferenceAccept the other default settings, and then click Continue.The Search Results page opens.16

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.17

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.18

Chapter 6: Building Script6.1 Recording an ApplicationThe Virtual User Generator module of LoadRunner, also called as VuGen creates artificialusers and records all our actions in the form of automated scripts. VuGen works on theprinciple of record and playback.In this section, you will learn to record an application using VuGen Module. Follow the stepsgiven 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 LoadRunnerTo 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.19

3. Creation of a New ScriptTo create a Vuser script, in the Start Page window, on the Scripts tab, click New VuserScript.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:20

a. New Single Protocol ScriptSelect this option if you want to make a selection from the Category list and select one ofthe protocols.b. New Multiple Protocol ScriptSelect this option to record more than one protocol in a single recording session. Thenselect the desired protocol from the Available Protocols list. Click the right-pointing arrow tomove the selection into the Selected Protocols list. Repeat the step to select all the desiredprotocols.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 applicationIn 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 recordInternet 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 tothe server "xyz" when starting "abc32.exe".21

d. Working Directory:This information is needed for some specific applications requiring us to specify a workingdirectory.8. Recording for Internet ApplicationsIn 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, typehttp://localhost:1080/MercuryWebTours/.d. Working directory:Specify a working directory for some specific applications. This information may differamong different types of Vuser scripts. Enter the details of the program to record, theworking directory, the Action & set the recording options by clicking “Options”.22

9. Record into Action boxNext, 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 Runningstatus.vuser end:It is used when recording a logoff procedure and it is executed when the Vuser finishes or isstopped. However, you can add a new section by clicking Actions Create New Actionand describe a new action name.10. Recording the application startupClick Record the application startup. When you do not want VuGen to record theapplication 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.23

12. Start the recordinga. On the login page of HP Web Tours, enter username as jojo and password bean, andthen click Login.A welcome page opens.b. Enter the flight details.On the welcome page, click Flights.The Find Flight page opens.24

c. On the Find Flight page, enter the following details: Departure CityDeparture DateArrival CityReturn DateSeating PreferenceKeep the rest of the default settings and click Continue.The Search Results page opens.25

d. Select a flight.Click Continue to accept the default flight selections.The Payment Details page opens.26

e. On the Payment Details page, enter the payment information and book flight, and thenclick Continue.The Invoice page opens, displaying your invoice.27

f. Check the itinerary.On the Invoice page, click Itinerary in the left pane.The Itinerary page opens.28

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.29

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 anddisplays the recording summary.The recording summary includes the protocol information and a list of the actions createdduring the session. For each step you perform during recording, VuGen generates asnapshot, a picture of the window during recording.6.2 Viewing the ScriptThe steps you performed on the travel agent application by logging in, booking a flight, andlogging off is recorded by VuGen from the moment you click the Start Record button untilyou click the Stop button. You can now view the script inside VuGen. The script can beviewed in Tree view or Script view. Tree view is an icon-based view that lists the actions ofthe Vuser as steps while Script view is a text-based view that lists the actions of the Vuseras functions.Tree ViewTo view the script in Tree view, click View Tree View. Alternatively, you can click theTree View button. To view the Tree View across the whole window, remove the Task paneby clicking the Task button. For each step you perform during recording, VuGen generatesan icon and a title in the test tree.In Tree view, you can see the actions of the user as script steps. Most steps areaccompanied by a corresponding snapshot of the recording. The snapshots make the scriptseasier to understand, and easier to share between engineers because you can see exactlywhich screen was recorded during the recording process. Later, you can compare thesnapshots to verify your script's accuracy. VuGen also creates snapshots of each step duringreplay.30

Script ViewScript view is a text-based view that lists the actions of the Vuser as API functions. To viewthe script in Script view, click View Script View. Alternately, click the Script Viewbutton. In Script view, VuGen shows the script in an editor with color-coded functions andtheir argument values. You can type C or LoadRunner API functions, as well as control flowstatements, directly into this window.31

Chapter 7: Playing Script7.1 LoadRunner Script Runtime SettingsAfter configuring load behavior, you will specify how your Vusers will behave during thetest. When emulating a real user, you need to consider the user's actual behavior. Behaviorrefers to the time that a user takes to pause between actions, the number of times herepeats 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. Theyinclude:a. Run LogicYou can instruct a Vuser to Repeat the Run section when you run the script. Each repetitionis known as an iteration.b. Number of IterationsLoadRunner repeats all of the actions for the specified number of times. If you specify ascenario duration in the controller, the duration setting overrides the Vusers iterationsettings.32

c. PacingThis setting controls the time between iterations. The pace tells the Vuser how long to waitbetween iterations of Vuser. You can instruct Vuser by following any of the followingmethods:1. As soon as the previous iteration ends2. After the previous iteration ends with a fixed / random delay3. At fixed / random intervalsd. LogVusers log information about themselves and their communication between server. Thereare two types of logs: StandardExtendedVuGen writes log messages that you can view in execution log.33

e. Think TimeWhen you run a Vuser script, the Vuser uses the think time values that were recorded intothe 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 TimeVuGen’s run-time viewer feature displays the Vuser activities in real time as you playbackthe recorded script. By default, VuGen does not display an animation of the actions in yourscript and runs your test in the background.For this tutorial, however, you will instruct VuGen to display the actions in a viewer that letsyou view each step that is executed by VuGen. The viewer is not an actual browser—it onlydisplays snapshots of the pages that are returned to the Vuser.34

1. Click Tools General Options Display.2. In the General Options dialog box, select the Show browser during replay and Autoarrange window check boxes. Clear Display report at the end of script executioncheck 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 thebottom of the instruction pane. Alternatively, you can press F5 or click the Run button onthe toolbar.5. If the Select Results Directory dialog box opens and ask you where you want to store theresults directory, accept the default name and click OK.After a short while, VuGen opens a run-time viewer and begins running the script in eitherscript view or tree view, depending on what you last had open. In the run-time viewer, youvisually observe the Vuser’s actions. You can note how the replay is an exact playback ofthe steps you performed during recording.35

recording.Run-time viewer7.3 View Information About the ReplayWhen the script stops running, you can view a summary of the replay in the wizard. To viewthe Last Replay Summary, in the task pane, click Verify Replay.36

The Last Replay Summary lists errors that may have been detected and also displaysthumbnails of the Recording and Replay snapshots. The Last Replay Summary helps youcompare snapshots and look for discrepancies between your recording and the replay. Youcan also look at the Vuser’s activity by reviewing a textual summary of the events. VuGen’sReplay Log tab in the Output window shows this color-coded information.7.4 Replay LogIn this section, you will learn how to open the replay log and locate some of the events andnotifications. To view the replay log, follow the steps given below:1. In the instruction pane, click the replay log hyperlink. Alternatively, you can clickthe Show/Hide output button in the toolbar or click View Output Windo

LoadRunner is a market-leading performance and load testing software that helps you . HP Web is aTours Web-based travel agency system. With this application, users can connect to a eb Wserver, search for flights, book flights, and check flight itineraries. While LoadRun

Related Documents:

Also See: Other LoadRunner Tutorials Loadrunner Load Testing Loadrunner Scripting Download Java Script Mercury Loadrunner HP Software Loadrunner Controller 10 comments Add a comment Carlos Vásquez Polanco · Santo Domingo, Dominican

500 LoadRunner Vusers. Web Vusers count for both LoadRunner Enterprise and Silk Performer. Note: Silk Performer is not included in the free LoadRunner Enterprise Community license. You will need a lic ense that contains LoadRunner Enterprise Vusers. Licensing works differently in LoadRunner Enterprise for multi-protocol scripts: a .

Jan 12, 2021 · Version 2021 . LoadRunner Professional and LoadRunner Enterprise . System Requirements (Product Availability Matrix) Document release d

Welcome to the HP LoadRunner Installation Guide. HP LoadRunner, a tool for performance testing, stresses your entire application to isolate and identify potential client, network, and server bottlenecks. This guide describes how to install and set up HP LoadRunner. Thi

Let us Learn & Master LoadRunner 9.0 Page 7 of 36 Load Runner: HP LoadRunner, a tool for performance testing, stresses your entire application to isolate and identify potential client, network, and server bottlenecks. HP LoadRunner load tests your application by emulating

WebLOAD vs. LoadRunner Competitive Analysis Page 3 Total Cost of Ownership With a rich set of features in par with LoadRunner, WebLOAD is offered at a fraction of the cost of LoadRunner. This includes a simple and transparent licensing model and an all-inclusive set of features (like server-side performance monitoring) at no additional costs.

HP0-M99 Advance LoadRunner and Performance Center 11.x ASE. Related Courses – LR230 - Protocol Library for LoadRunner 11.x – LR320 - Advanced Analysis for LoadRunner 11.x – PC120 – Performance Center 12.0 Essentials. Overview . This five-day course introduces students to LoadRunner 12.0. The course covers topics about the Virtual

API Structure Over 500 member companies involved in all aspects of the oil and natural gas industry Over 700 committees and task forces covering various advocacy and technical issues Staff of 240 led by board of directors who are the CEO’s of API member companies . API Standards Program All industry segments active in standardization: Exploration and Production Refining Petroleum .