qspiders - simple recording and configuration of recording options for hp load runner

38
Simple recording and Configuration of Recording options for HP LoadRunner

Upload: qspiders-software-testing-training-institute

Post on 16-Apr-2017

110 views

Category:

Education


2 download

TRANSCRIPT

Page 1: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Simple recording and Configuration

of Recording options for HP

LoadRunner

Page 2: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

The LoadRunner Solution

Virtual User Generator

Generates load and collects test results

Creates Scripts as one Single User.

Compiles and displays test results with graphical and statistical tools

LoadRunner Controller

LoadRunner Analysis

Page 3: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Terminology

• Scenarios• Using LoadRunner, you divide your application performance testing

requirements into scenarios.• A scenario defines the events that occur during each testing sessions.• 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 a scenario, LoadRunner replaces human users with virtual users or Vusers.• When you run a scenario, Vusers emulate the actions of human users—

submitting input to the server. • A scenario can contain tens, hundreds, or even thousands of Vusers.

3Contd….

Page 4: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Terminology

4

• Vuser Scripts• The actions that a Vuser performs during the scenario are

described in a Vuser script.• When you run a scenario, each Vuser executes a Vuser script.

Vuser scripts include functions that measure and record the performance of the server during the scenario.

• Transactions• To measure the performance of the server, you define

transactions. • Transactions measure the time that it takes for the server to

respond to tasks submitted by Vusers.

Contd….

Page 5: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Terminology

5

• Rendezvous Points• You insert rendezvous points into Vuser scripts to emulate heavy user

load on the server. • Rendezvous points instruct multiple Vusers to perform tasks at exactly

the same time. • For example, to emulate peak load on the bank server, you insert a

rendezvous point to instruct 100 Vusers to simultaneously deposit cash into their accounts.

• Controller• You use the LoadRunner Controller to manage and maintain your

scenarios. • Using the Controller, you control all the Vusers in a scenario from a single

workstation.

Contd….

Page 6: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Terminology

6

• Hosts• When you execute a scenario, the LoadRunner Controller distributes

each Vuser in the scenario to a host. • The host is the machine that executes the Vuser script, enabling the

Vuser to emulate the actions of a human user.

• Performance Analysis• Vuser scripts include functions that 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 7: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Components

7

ControllerVuGen

Analysis

LoadRunner

Tuning

Contd….

Page 8: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Components of LoadRunner 12.02.0

8

• VuGen (Virtual User Generator) – records Vuser Scripts that emulate the steps of real Users using the application

• The Controller is an administrative center for creating, maintaining, and executing scenarios. Starts and stops load tests, and perform other Administrative tasks

Contd….

Page 9: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Components of LoadRunner 12.02.0

9

• LR Analysis uses the load test results to create graphs and reports that are used to correlate system information and identify both bottlenecks and performance issues.

• Tuning helps you quickly isolate and resolve performance bottlenecks. By adding a centralized tuning console to LoadRunner, the Mercury Tuning Module ensures that performance bottlenecks are resolved during testing, and helps you determine the optimized configuration settings for production.

Page 10: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

How LoadRunner Works?

Page 11: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

LoadRunner Expert Workflow

TuneSystem Basedon Analysis

AnalyzeSystem Under Load

Phase 5

LoadRunnerV U G E N

LoadRunnerC O N T R O L L E R & A N A L Y S I S

RunScenarios

Phase 4

CreateScenarios

Phase 3

Create Web Virtual Users

Phase 2Phase 1

Plan Load Test

Page 12: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Plan Load Test Identify Business Critical Scenarios. Scenario means a manual work flow. Ex: Login Open an Account Logout. Estimate User Load Performance Testing requirements will give an idea of users load or the number of users using the product. This will determine the load to be used against the product in testing. Work Load: Ex: 100 user Running together. Of this 60 users book a Browse a website. 30 users search a product and 10 users buy the Product.

Page 13: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

What is Virtual User (Vuser)?

• Virtual users or Vusers emulate the steps of real users. The steps that Vusers perform are recorded in a Vuser Script.

Page 14: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

What is VuGen (Virtual User Generator)?• VuGen records Vuser Scripts that emulate the steps

of real users using the application• VuGen not only records Vuser scripts, but also runs

them. Running scripts from VuGen is useful for debugging

• VuGen records sessions on Windows platforms only. However, a recorded Vuser script can run on both Windows and UNIX platform.

Page 15: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Process of Recording Script• Record a basic script• Enhance the basic script by adding the control-flow

statements and other Mercury API functions into the Script

• Configure the Run-time settings• Verify that the script runs correctly, run it in stand-

alone mode• Integrate into your test : a LoadRunner scenario,

Performance Centre load test, Tuning module session, Business process monitor profile

Page 16: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

VuGenWhat We can Do?

Set up recording options Record the scripts Add Comments Insert Start and End Transactions Perform Correlation Add Checks Add C programming Statements wherever required. Insert Load Runner Functions if required. Do Parameterization. Add Rendezvous Point Create Multiple actions If required. Perform Run Time Settings

Page 17: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Welcome Screen - VuGen

17

Single Protocol Script Multiple Protocol Script

Creates a single protocol Vuser script. This is the default option

Creates a multiple protocol Vuser script. VuGen displays all of the available protocols and allows you to specify which protocols to record

Page 18: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Vuser Script Sections

18

• Each Vuser script contains at least three sections:• vuser_init• one or more Actions and • vuser_end.

the Vuser finishes or is stopped

a logoff procedurevuser_end

the Vuser is in "Running" status

client activityActions

the Vuser is initialized (loaded)

a login to a servervuser_init

Is executed when...Used when recording...

Script Section

Page 19: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

VuGen Editor

19

Page 20: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Recording Options

Whenever VUGen generates a script, the code generated is based on various configurations that can be found under the “Recording Options” – or you can press Ctrl + F7 to view the Recording Options

Page 21: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Recording Options

21There are various categories of configurations like General, Correlations, Network and Data Format Extension.

Page 22: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

General => Recording:

22

Page 23: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

1.The HTML-based script is based on user actions, and the scripts contain functions that correspond directly to the action taken.

2.The URL-based script is based on HTTP requests sent to the server as a result of user actions

Page 24: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Benefits of HTML RecordingAdvantages of HTML Recording

Reduces need to capture dynamic values - Action tag values and hidden data are NOT hardcoded- They are retrieved from memory during playback - If they are dynamic, the VUser still run Script is only as big as the business process–one step per pageDisadvantages of HTML Recording- requires more memory- requires more CPU power

24

Page 25: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Benefits of URL RecordingAdvantages of URL recording-Flexibility- Support for Java Applets and ActiveX objects on the page- Ability to replay on UNIX - Scripts are more scalable than HTML scripts because they require fewer resourcesDisadvantages of URL recordingScripts require more correlation (nothing is retrieved from the cache) Context-sensitive checks won’t work (parser is disabled) Scripts are large (all images and frames are recorded as separate steps)

25

Page 26: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Difference between

HTML Mode and URL ModeHTML Mode

• Intuitive and easy to understand

• Scripts are smaller, requests are encapsulated and easy to understand

• Scalable

URL Mode• Not as intuitive as

the HTML scripts.• Scripts are large,

containing a call to each image, css, html, etc. thus making it difficult to understand.

• More scalable and effective for creating a load test

26

Page 27: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

General => Script:

27

Page 28: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Does load runner understand any other language-

You’ll notice that Language dropdown is disabled. A common myth is that the LoadRunner does not generate code in any other language. Another myth is that it requires a license to work in other languages.

Both are false. LoadRunner decides for itself which language to use when generating the script. In almost all cases, you’ll find yourself working with C Language.

For certain java applications (like Java applets) the code being generated will be in Java Script Language.

VUGen will generate a script in VBScript Language only for applications developed in Visual Basic classic

28

Page 29: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Scripting Options “Generate fixed think time after end transaction”. This means, no

matter how much a user wait, the think time generated (the delay) will be equal to value specified. The value is in seconds.

Maximum number of lines in the action file refers to the maximum number of lines VUGen will generate in an action. If the script is larger, VUGen will automatically create a new action. The default is set to 60,000. The maximum value which can be specified is 65,000

This configuration helpful when dealing with a desktop application with Oracle on the backend.

29

Page 30: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

General => Protocol

Gives you an option to select and deselect any protocols you’ve selected at the start of recording (In case wrongly selected)

30

Page 31: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

General => Code Generation:

This configuration tells VUGen to find candidates for correlation at record time. If you do not wish for Automatic Correlation, then you might wish to turn off this feature

31

Page 32: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Correlation => Configuration:

• Although automatic correlation is helpful from 5% to 10% only, yet you can select “Rules Scan” and “Automatically correlate values found”. However, if your script doesn’t play, you can consider restoring to defaults by clicking on button.

32

Page 33: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Correlation => Rules:• Go to Rules, and

here you can see various rules VUGen is using to find correlation Parameters. You can add custom rules if you know what your application is using as parameters. However, this is an advanced use of record time settings.

33

Page 34: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

HTTP Properties => Advanced: Reset context for

each action, enabling this option instructs VUGen to reset all HTP contexts between actions to their initial state before recording, providing a clean beginning for the recording session. The option is enabled by default.

You can leave the rest of configurations intact, unless required

34

Page 35: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Network => Port Mapping:• Go to Options (as long as you’re not using Socket level data) and select various options like SSL version or other types of Secure Socket Layer

35

Page 36: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Other Settings-• This option will be used in case of specific projects

36

Page 37: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Recording Your Application

37

• Click the Start Recording Button• For most Client / Server protocols, the following Screen opens

• Recording Tool Bar (Floating Tool Bar)

Page 38: QSpiders - Simple Recording and Configuration of recording options for HP Load Runner

Ending and Saving a Recording Session

To complete the recording: •After you record a typical business

process, you complete the recording session by performing the closing steps of your business process and saving the Vuser script.

•Switch to the vuser_end section in the floating toolbar, and perform the log off or cleanup procedure.

•Click the stop Recording button on the recording Tool Bar

38