Top Banner
©2009 HP Confidential 1 Performance Testing – Basics of HP LoadRunner Lesson 1 to 4
67

Basics of HP LoadRunner - Lessons 1 to 4

Nov 22, 2015

Download

Documents

richard_lr11

Basics of HP LoadRunner - Lesson 1 to 4
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

TCM Training Template

Performance Testing Basics of HP LoadRunner Lesson 1 to 42009 HP Confidential#COURSE OUTLINEPre-work: HP Web Tours Overview and DemoLesson 1: General Concepts Performance Testing OverviewLoadRunner OverviewLoadRunner Components OverviewLesson 2: HP LoadRunner InstallationLesson 3: HP LoadRunner Components Overview

Lesson 4: Virtual User GeneratorIntroduction to Virtual User GeneratorVirtual User Generator InterfaceScript Recording and PlaybackScript EnhancementTransactionParameterCorrelationVerification

Debugging ToolsDay 2 Wrap Up Quiz

HP CONFIDENTIAL2Pre-work: HP Web Tours Overview and Demo 2009 and HP Confidential // #HP CONFIDENTIALWhat is HP Web Tours?HP Web Tours is a Flight Reservation simulation web application used for demo of HP testing tools such as Quality Center, Quick Test Professional and LoadRunner.

To Access:Click Start > All Programs > LoadRunner > Samples > Web > Start Web Server (Xitami Web Server icon will be visible in the system tray.) Click Start > All Programs > LoadRunner > Samples > Web > HP Web Tours Application (or type URL = http://127.0.0.1:1080/WebTours/ in Internet Explorer)

HP CONFIDENTIALLesson 1: general concepts 2009 and HP Confidential // #HP CONFIDENTIALPerformance Testing: Overview Performance Testing - performed to determine how fast some aspect of a system operates under a particular workload. It can also serve to validate and verify other quality attributes of the system, such as scalability, reliability and resource usage.a subset of Performance Engineering, an emerging computer science practice which strives to build performance into the design and architecture of a system, prior to the onset of actual coding effort. OBJECTIVE: to proactively diagnose and eliminate performance problems before releasing the system into a production environment by running model use loads against the system. HP CONFIDENTIAL6Performance Testing: Overview Types of Performance Testing:Load Testing - conducted to understand the behavior of the application under a specific expected load.Stress Testing - used to understand the upper limits of capacity within the application landscape. Endurance Testing (Soak Testing) - done to determine if the application can sustain the continuous expected load. Spike Testing - done by spiking the number of users and understanding the behavior of the application; whether performance will suffer, the application will fail, or it will be able to handle dramatic changes in load.Configuration Testing - testing the effects of configuration changes in the application landscape on application performance and behaviour. A common example would be experimenting with different methods of load-balancing.Isolation Testing done to isolate transactions that have performance problems irrespective of load to find if there are any bottlenecks

HP CONFIDENTIAL7LoadRunner: Overview HP LoadRunner - a performance testing solution that tests system behavior and performance.exercises the enterprise infrastructure by emulating any number of users while employing performance monitors to identify and isolate performance problems.helps enterprises identify bottlenecks before releasing applications to production, maximize the productivity of QA cycles by testing hardware and software applications and servers, not just business logic, and accelerates and reduces the risk of deployment by ensuring any system level problems have been identified and resolved before going to production. HP CONFIDENTIAL8LoadRunnerManual Testing is Problematic

HP CONFIDENTIAL9Having a hundred testers complete the same set of actions simultaneously is not very practical. Even if you manage to carry this out, how would you measure the results accurately? How do you synchronize users? How do you repeat the tests?LoadRunner Solution Using minimal hardware resources, LoadRunner emulates any number of users (hundreds or thousands) to put the application through the rigidity of real-life user loads.

HP CONFIDENTIAL10LoadRunner overcomes the limitations of manual testing. It replaces testers with Virtual Users, it eliminates the need for massive resources, it records scripted actions for test repetitions and it has an analysis tool to provide meaningful results.Lesson 2: Hp Loadrunner Installation 2009 and HP Confidential // #HP CONFIDENTIALLicensing Overview

The license key controls the number and type of virtual users and the type of monitors that can be used in the Controller. LoadRunner licenses keys are installed on the Controller and locked to the computer by a Host ID. LoadRunner generates the Host ID in the Controller and when a license is created this Host ID value is part of the license key. This locks the license key to a specific computer.Five Types of LoadRunner Licenses:Permanent - The permanent license never expires but only entitles the user to a single version of the softwareTime Limited - The license is limited by a start date and expiration date. Temporary - The license is granted for a pre-defined number of days after product installation. VUD-Based - The license is limited by a number of Virtual User Days (VUDs). A VUD license enables the user to use the product an unlimited number of times within a period of 24 hours. Perpetual The license has a defined number of Vusers that can be used unlimitedly forever. The user is entitled to support, new product versions, and patches.HP CONFIDENTIALLoadRunner Full Setup

The Full Setup has two options:Typical Installation - installs: the Controller, Virtual User Generator, Virtual User components, online documentation, script samples, Load Generator, MI Listener, support for Remote Performance Monitor. This installation should be used for the computer that will control the Vusers.Custom Installation - allows a user to select the specific components to install. These components include: the Controller, Analysis, Vuser Generator, Load Generator, MI Listener, Monitors Over the Firewall, Online Documentation and Samples.HP CONFIDENTIALLesson 3: Hp Loadrunner Components overview 2009 and HP Confidential // #HP CONFIDENTIALLoadRunner Components Overview

LoadRunner comprises of four components:

Virtual User GeneratorLoad GeneratorControllerAnalysis

HP CONFIDENTIAL15LoadRunner Components Overview:The Launch Screen To invoke LoadRunner Launch Screen in Windows:Go to All Programs > LoadRunner Then Click:

HP CONFIDENTIAL16

LoadRunner Components Overview:The Launch Screen Invokes the Virtual User Generator (VuGen)HP CONFIDENTIAL17

LoadRunner Components Overview:Virtual User Generator VuGen is used in developing scriptsHP CONFIDENTIAL18

LoadRunner Components Overview:The Launch Screen Invokes the ControllerHP CONFIDENTIAL19LoadRunner Components Overview:Controller

Controller is used in executing and monitoring testsHP CONFIDENTIAL20

LoadRunner Components Overview:The Launch Screen Invokes the AnalysisHP CONFIDENTIAL21LoadRunner Components Overview:Analysis Analysis is used in evaluating the performance of an application

HP CONFIDENTIAL22LoadRunner Components Overview

Alternatively, LoadRunner Application can be invoked in Windows by going to:All Programs > LoadRunner > Applications

HP CONFIDENTIAL23

LoadRunner Components Overview:Load GeneratorLoad Generator hosts the Virtual Users that will be generating the load against the application under test You can tell its running by the satellite dish icon in the Windows task bar at the lower right corner of your screen.HP CONFIDENTIAL24Lesson 4: virtual user generator 2009 and HP Confidential // #HP CONFIDENTIALVirtual User Generator:IntroductionThe Virtual User Generator, also called VuGen, is LoadRunner's script development tool. VuGen uses a business process recording technology that allows users to record a business process and VuGen generates a performance testing script based on the users actions. A business process is a series of steps that when executed achieves a business objective HP CONFIDENTIAL26One simple example of a business process is searching using a search engine.Virtual User Generator:IntroductionThe script that VuGen creates is a recording of the communication between the client and the server There are several different types of virtual users, all of which are based on the application protocol that is used between the client and the server.Examples: HTTP/HTML, SAPGUI, Citrix, Enterprise Java BeansHP CONFIDENTIAL27Virtual Users or Vusers emulate the steps of real users.VuGen Interface

There are three views present in VuGen:1. Tasks (Workflow Wizard) View2. Tree View3. Script ViewHP CONFIDENTIAL28VuGen Interface: Tasks View

The Tasks view shows a list of the tasks required in order to create a functional script. HP CONFIDENTIAL29Task Pane contains the summary of the current task and the subsequent task you need to execute in order to complete your workflow.Information Pane contains relevant information based on the current step you are in the workflow.Thumbnails Pane contains the recorded and replay snapshots of the application under test.VuGen Interface: Tree View

The Tree view shows a graphical representation of each one of the script's steps.HP CONFIDENTIAL30Task List Pane contains the summary of the current task and the subsequent task you need to execute in order to complete your workflow.Icon-based Tree View gives you a visual representation of the functions and your sub-elements.Snapshot View shows the current page view of the current step selected in the icon-based tree view. It is the data returned by the server as it was done during recording. You can also view the replay snapshot during debugging.VuGen Interface: Script View

The Script view shows the actual functions that were generated in the script. HP CONFIDENTIAL31Script Recording: Creating a New Script

ONEYou can create a new script by Going toFile > NewOr clicking the following icon on the toolbar

HP CONFIDENTIAL32Script Recording: Creating a New Script

TWOHP CONFIDENTIAL33Script Recording: Creating a New Script

THREEHP CONFIDENTIAL34Script Recording:Configuring the Recording OptionsTo configure the Recording Options: Go to Tools > Recording Options Or click the following icon on the toolbar

HP CONFIDENTIAL35Script Recording:Recording Options Script Level

Modification of Scripting Language and Scripting OptionsHP CONFIDENTIAL36Script Recording:Recording Options Recording Level

HTML records in browser modeURL records in analog modeHP CONFIDENTIAL37Script Recording: Recording the Script

Alternatively, you can start the recording by Going toVuser > Start Recording- Or clicking the following icon on the toolbar

HP CONFIDENTIAL38Script Recording: Recording the Script

3. Perform user steps for recording

Please note that the increase in the number of events signifies that steps are being recordedHP CONFIDENTIAL39Script Playback: Configuring theRun-time SettingsTo configure the Run-time Settings: Go to Vuser > Run-time Settings Or click the following icon on the toolbar

HP CONFIDENTIALScript Playback: Run-time Settings Run Logic Level

Defines how many times the Vuser will repeat the Action section in the scriptHP CONFIDENTIALScript Playback: Run-time Settings Pacing Level

Defines the delay after each iterationHP CONFIDENTIALScript Playback: Run-time Settings Log Level

Logs information about the communication with the serverHP CONFIDENTIALScript Playback: Run-time Settings Think Time Level

Defines the delay after each stepHP CONFIDENTIALScript Playback: Configuring theGeneral OptionsTo configure the General Options: Go to Tools > General Options

HP CONFIDENTIALScript Playback: Running the Script

Alternatively, you can start replay by Going toVuser > Run- Or clicking the following icon on the toolbar

HP CONFIDENTIALScript Enhancement: Transactions

Transactions measure the transmission and response time between client and server. Transactions can be added DURING and AFTER recording HP CONFIDENTIALScript Enhancement: Transactions How to Add Transactions?During Recording: Click on the Start/End Transaction buttons on the floating toolbarAfter Recording: Script View:Manually add the functions lr_start_transaction() and lr_end_transaction() in the LR scriptTree View:Right-click on a script step and select either Insert After, to insert end transaction after a step or Insert Before, to insert start transaction before a step Click on the Insert Start Transaction and Insert End Transaction icons present on the Toolbar

HP CONFIDENTIALScript Enhancement: Parameters Parameterization is the process of replacing hard-coded values in a script with varying values defined in a placeholder.

HP CONFIDENTIALScript Enhancement: Parameters When to parameterize?

HP CONFIDENTIAL50Unique Constraint consists of unique data which can only be used by only one Vuser at a time.Date Constraint consists of data which contains date. Certain data requires specific date in order to work properly.Data Dependency when one set of data depends on another.Data Caching use varying data in order to make sure that the applications database does not use cached data.Script Enhancement: Parameters Parameter Types Internal Data generated internally in the script Data Files holds data that a script accesses during executionExamples of Internal DataDate/TimeIteration NumberVuser IDUnique Number

HP CONFIDENTIALScript Enhancement: Parameters How to Add Parameters?Tree View:Right-click on a script step and editing its propertiesScript View:Locate the data to be parameterized in the script, highlight it, right-click on it and choose Replace with a Parameter.

HP CONFIDENTIALScript Enhancement: Parameters To View the Parameter Properties:Alternatively, you can view the parameter properties by Going to: Vuser > Parameter List

Click the Properties button on the Select or Create Parameter window

- Or clicking this icon on the toolbarHP CONFIDENTIALScript Enhancement: Parameters Parameter List Window:

Types of ParameterParameter File PathEdit Values of ParameterSimulate ParameterData Assignment and Update MethodsAdd/Delete ParametersHP CONFIDENTIALScript Enhancement: Parameters Parameter Types:

Select New Row Methods:

Sequential - assigns data to a Vuser sequentially. Random - assigns a random value from the data table to each Vuser at the start of the test run. Unique - assigns a unique sequential value to the parameter for each Vuser.

HP CONFIDENTIALScript Enhancement: ParametersUpdate Value Methods:

Each iteration - instructs the Vuser to use a new value for each script iteration. Each occurrence - instructs the Vuser to use a new value for each occurrence of the parameter. Once - instructs the Vuser to update the parameter value only once during the scenario run. When Out of Value Update Methods:

Abort Vuser - stops the Vuser or script when out of data. Continue in a cyclic manner - starts from the beginning of the parameter table when out of data. Continue with last value - keeps using the last value in the parameter table when out of data. HP CONFIDENTIALScript Enhancement: Correlation Correlation - process of enhancing a VuGen script to handle dynamic data passed between the client and the server.

HP CONFIDENTIALScript Enhancement: CorrelationThree ways to correlate a script: Automatic correlation after recording Find correlations in the script by Going to: Vuser > Scan Script for Correlations Or clicking the following icon on the toolbar Automatic correlation during recording VuGen can correlate dynamic data based on Predefined Rules in the Recording Options Manual correlation

HP CONFIDENTIALDemo on Predefined Rules58

Comparing Vuser Scripts using WDiffA useful tool in determining which values to correlate is WDiff. This utility lets you compare recorded scripts and results to determine which values need to be correlated. To use WDiff effectively, you record the identical operation twice, and compare the scripts. WDiff displays differences in yellow. Note that not all differences indicate a value to correlate. Go to Tools > Compare with Vuser. Specify a Vuser script for comparison (other than the one in the current VuGen window) and click OK. WDiff opens and the differences between the Vuser scripts are highlighted in yellow. How to Invoke WDiff?HP CONFIDENTIALScript Enhancement: Verification Verification confirms the functional integrity of an application under concurrent users

HP CONFIDENTIALScript Enhancement: Verification A text check is a search for a specified text string on a web page, which adds a web_reg_find function to the script

Inserting text verification checks can be done during and after recording During: Enable Generate web_reg_find functions for page titles under Recording Options > HTTP Properties > Advanced before the start of recordingClick the Insert text check icon in the floating toolbar After: Right-click on a script step and select Insert Before, to insert a web_reg_find function before a step

HP CONFIDENTIALDebugging Tools

Four tools used in debugging:Run Time ViewerReplay SummaryTest ResultsReplay LogHP CONFIDENTIALDebugging Tools: Run-Time Viewer Run-Time Viewer enables the user to watch the replay of actions done on the Web application while debugging the script.

HP CONFIDENTIALDebugging Tools: Replay Summary Replay Summary displays the result of the script execution

HP CONFIDENTIALDebugging Tools: Test Results Test Results window shows the overall results and detailed level report on each step

HP CONFIDENTIALDebugging Tools: Replay Log Replay Log displays messages that describe the actions of the script as it executes

HP CONFIDENTIAL

End of day 2Prepare for a quiz 2009 and HP Confidential // #HP CONFIDENTIAL