api.ning.comapi.ning.com/.../loadrunnerpurvang.docx  · web viewload runner . load runner...

28
Load Runner Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test on your entire system to identify any potential client, network and server issues. Steps for Load Runner proceeds: Step 1: Planning the test Step 2: Creation of Vusers Step 3: Creation of the scenarios Step 4: Running the scenario Step 5: Monitoring the scenario Step 6: Analyzing test results Load Runner Primarily 3 stage architecture consisting of the User(Virtual User),Controller and the Analysis. A Typical Performance Testing Process would consist of a) Planning your load test b) Crating User Scripts c) Crating load Scenarios d) Run the Load Tests E) Analyze Results f) Fine tune your system. Definition: Load Runner is a Mercury Interactive Tool that predicts performance and behavior of the system. By Crating lots of load, You can see how the system reacts at peak levels or with simultaneous Users. Load Runner accurately measures and analyzes the system performance and its functionality. Prepared By: Purvang Page 1

Upload: lymien

Post on 04-Feb-2018

235 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Load Runner

Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test on your entire system to identify any potential client, network and server issues.

Steps for Load Runner proceeds:Step 1: Planning the testStep 2: Creation of VusersStep 3: Creation of the scenariosStep 4: Running the scenarioStep 5: Monitoring the scenarioStep 6: Analyzing test results

Load Runner Primarily 3 stage architecture consisting of the User(Virtual User),Controller and the Analysis.

A Typical Performance Testing Process would consist of a) Planning your load test b) Crating User Scripts c) Crating load Scenarios d) Run the Load Tests E) Analyze Results f) Fine tune your system.

Definition: Load Runner is a Mercury Interactive Tool that predicts performance and behavior of the system.

By Crating lots of load, You can see how the system reacts at peak levels or with simultaneous Users.

Load Runner accurately measures and analyzes the system performance and its functionality.

Component of Load Runner are: Vuser , controller, Analysis, Tuning.Vuser: Recording a script in the Vuser component of Load Runner.Controller: Create & Run scenario in the controller section of Load runner.Analyze: Analyze test Results in Monitoring and Analysis tool.

In Load Runner you can record single or multiple protocols scripts , depending on your requirements.

Prepared By: Purvang Page 1

Page 2: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

HTML based script, record html based on user actions. It is the recommended mode of recording.

URL based script, recorded all requests and resources from server.

Parameterization: It allows you to test your script with different values.Reduces the size of your script steps in Parameterization.Replace the constant values in Vuser Script with parameters.Set the data source for the parameter , so different values can be selected at run time.

Verification Checkpoints: A checkpoint compares stored value with actual value and reports pass or fail status.

You can create a checkpoint during recording or while` Enhancing the Vuser script.

Types of checkpoints: Text Check Image Check

Controller has two sections: Design section- Used to design the load testing Scenario.

Run section- Used to monitor scenario which are in

execution.

Analyzer: It is used to observe data and a graph recorded during the load test.90 % column gives the time required to complete the transaction in 90%

time. It is possible to correlate & merge graphs.

Communication between user and web server :

Prepared By: Purvang Page 2

Page 3: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Vuser(virtual user) or Vegan(virtual Generator)

Vuser: Recording a Script.This allows us to specify the information to be recorded and which function to be used when generating a script.

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

Prepared By: Purvang Page 3

Page 4: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

URL mode: The URL mode is based on HTTP request send to the server as a result of user actions.

Controller

Create and Run Scenario.Scenario: It describes the events that occur during a testing session.

It is the means by which you emulate a real-life user.It includes a list of machines on which Vusers run.A list of scripts that the Vusers or Vuser groups that run during the scenario.Scenarios are created using the Load Runner controller.

Manual Scenario: Create a scenario by defining Vuser groups to which are assigned a quantity of individual Vusers, Vuser scripts, and load generators to run the scripts.Goal Oriented scenario: For web tests, the goals of the tests are defined by us and Load Runner automatically builds a scenario based on these goals.Manual Scenario:

You control the number of running Vusers at the time which they run.

You can specify how many Vusers run simultaneously. Allows you to run the Vuser in percentage mode.

Goal-Oriented scenario: Determine the system to achieve a particular goal. The goal may be number of hits per second,Number of

transaction per second, etc., Manages Vusers Automatically to maintain and achieve the

goal.Load Generator for your scenario:

Load Generator is a machine that saves as the host for running Vusers.

It’s important to know that which script needs to be run from which location.

For example customer activity, the function of location , workload of location…etc.,

Prepared By: Purvang Page 4

Page 5: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

There are three parts in Scenario: Vuser_init-a login to server Actions-client activity Vuser_end-a logoff procedure

Analysis & Reports

Load Runner Analysis: Analysis provides graphs and reports to help you analyze

the performance of your system. These graphs and reports summarize the scenario

execution.To view a summary of the results after test execution,you can use one or more of the following tools:

Vuser log files Controller output window Analysis graphs Graph data and raw data Report

Data Aggregation: Aggregate data-To reduce the size of the database. Select the type of data to aggregate-Specify the types of

graphs for which you want to aggregate data. Select the graph properties to aggregate-specify the graph

properties ( Vuser ID, Group Name, Script Name)

Analysis Graphs:

Prepared By: Purvang Page 5

Page 6: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Vuser graphs Error graphs Transaction graphs Web resource graphs Web page breakdown graphs User-defined data point graphs System resource graphs Network monitor graphs Firewall server monitor graphs Web server resource graphs Web application server resource graphs Database server resource graphs Streaming media graphs ERP/CRM server resource graphs Java performance graphs Application component graphs Application deployment solutions graphs Middleware performance graphs Security graphs Application traffic management graphs Infrastructure resources graphs Siebel diagnostics graphs Siebel DB diagnostics graphs Oracle diagnostics graphs J2EE diagnostics graphs

Analysis Report: Analysis Report includes the following sections.1. Understanding analysis Reports2. Creating a Microsoft word Report

About Analysis Reports Viewing summary Reports Creating with Transaction Reports Working with Transaction Reports Data Point Reports Failed Transaction Report Failed User Report Detailed Transaction Report Transaction Performance by Vuser report

Analysis Reports:

Prepared By: Purvang Page 6

Page 7: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Summary Report HTML Reports Transaction Reports-Transaction reports provide

performance information about the transaction defined within the Vuser scripts.

Activity Performance

Activity Report: Scenario Execution Failed Transaction Failed Vusers

Rendezvous point: Into Vuser script to emulate heavy user load on the server. Rendezvous point instruct Vusers to wait during test

execution for multiple Vuser to arrive at a certain point. In order that they may simultaneously perform a task.

Some important function: Ir_debug_message – The Ir_debug_message function sends

a debug message to the output log when the specified message class is set.

Ir_output_message – The Ir_output_message function sends notifications to the controller output window and the Vuser log file.

Ir_error_message – It is sends an error message to the Load Runner output window.

Ird_stmt – It is associates a character string (usually a SQL statement ) with a cursor.

Ird_fetch – It is fetches the next row from the result set. Web_reg_save_param – It is a function to capture dynamic

values in the web Vuser script.

In script there are two types of script view: Tree view Script view

Prepared By: Purvang Page 7

Page 8: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Correlation: Many applications use dynamic values that changes each time youUse the application.For example, some servers assign a unique session ID for every new session. When you try to replay a recorded session, the application creates a new session ID that differs from the recorded session ID.

Load Runner addresses this issue through correlation. Correlation saves the changing values, in our case the session ID, to a parameter.When running the emulation the Vuser does not use the record value-instead, it uses the new session ID, assigned to it by the server.

Types of Protocols supported: Java protocols FTP,SOAP,HTML,HTTP Oracle Protocols SMTP,IMAP,POP3 MMS, Voice XML,WAP protocols

Prepared By: Purvang Page 8

Page 9: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Terminal Emulation (RTE)

Use of Load Runner: Suppose are assigned to load test eBay website for 1000

users accessing the site at the same time – a very normal load for a site like eBay.

Now, you cannot possibly arrange 1000 human users at different PC’s all accessing eBay at the same time.

What you need a is some software which could simulate these 1000 users for you.

Enter Load Runner!

Types of Graphs : Hits per second graph Pages download per second graph Transaction Response time(under load) graph Transaction Response time(percentile) graph Network delay time graph Overlay graph Correlate graph

Standard and extended logs : Standard log option: When you select standard log, it

creates a standard log of function and messages sent during script execution to use for debugging.

Extended log option: Extended log to create an extended log, including warnings and other messages.Disable this option for large load testing scenarios.

Types of performance testing : Component testing-Find the behavior and performance of

each tier. Load testing-Find out whether the system can handle the

expected load upon deployment under real-world conditions.

Stress testing-Find the application’s breaking point.

Prepared By: Purvang Page 9

Page 10: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Volume testing-Find the stability of the system with respect to handling large amounts of data over extended time periods.

Load Runner vs Topaz : Load Runner = Performance testing TOPAZ = Performance testing- With TOPAZ, your goal is

to not introduce additional load to impact others users, but to sample at rate sufficient to determine the average user’s experience in navigating an application/site/api/etc…

For example, one user logging in and checking how long it takes to pull up an account once every ten minutes.

Script built for load testing with loadrunner can be used by Topaz for monitoring without modification.

Example of Vuser script :

Example of Parameter Passing :

Prepared By: Purvang Page 10

Page 11: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

LRD Functions : The functions developed to emulate communication between a

database client and server are called LRD Vuser functions. Each LRD Vuser function has an Ird prefix.

Access Management Functions: Ird_alloc_connection- Allocates a connection structure Ird_close_all_cursors- Close all open cursors Ird_close_connection- Disconnects(log out) from the database Ird_close_context- Close a context Ird_commit- Commits the current transaction

LRD Environment Functions: Ird_msg- Issues an output message Ird_option- Sets an LRD option Ird_end- Closes the Ird environment Ird_init- Initializes the Ird environment

Retrieval Handling Functions: Ird_col_data Ird_fetch Ird_fetchx Ird_result_set Ird_fetch_adv

Statement Handling Functions: Ird_bind_col Ird_bind_cols Ird_cancel Ird_data_info Ird_dyanamic

Statement Correlating Functions:

Prepared By: Purvang Page 11

Page 12: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Ird_save_col Ird_save_value Ird_save_ret_param Ird_save_last_rowid

Variable Handling Functions: Ird_assign Ird_assign_ext Ird_assign_literal Ird_assign_bind_ext Ird_assign_bind_literal

Ramp up : This option is used to gradually increases the amount ofVusers/load On the server. An initial value is set and a value to wait between intervals can be specified.To set Ramp Up, go to Scenario Scheduling Options.

Throughput & Response : The Throughput graph shows the amount of data in bytes that the Vusers received from the server in a second.When we compare this with the transaction response time, we well notice that as throughput decreased.

The Response time also decreased. Similarly, the peak throughput and highest response time would occur approximately at the same time.

Prepared By: Purvang Page 12

Page 13: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Runtime setting : The run time setting that we make are :- Pacing-It has iteration count. Log-Under this we have disable logging standard log and

Extended think time-In think time we have two options like Ignore think time and replay think time.

General-Under general tab we can set the Vusers as process or as multithreading and whether each step as a transaction.

Think Time : Think time is the time that a real user waits between actions. Example : When a user receives data from a sever, the user may wait several

second to review the data before responding.

Prepared By: Purvang Page 13

Page 14: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

This delay is known as the think time.

The Configuration of your systems : The configuration of our system refers to that of the client

machines on which we run the Vusers. The configuration of any client machine includes its hardware

settings, memory, operating system, software applications, development tools,etc.

This system component configuration should match with the overall system configuration that would include the network infrastructure, the web server. The database server, and any other component that go with this larger system so as to achieve the load testing objectives.

The performance bottlenecks : Performance Bottlenecks can be detected by using

monitors. These monitors might be application server

monitors, web server monitors, database server monitors and network monitors.

They help in finding out the troubled area in our scenario which causes increased response time.

Overlay Graph : It overlay the content of two graphs that shares a common x-axis. Left y-axis on the merged graph show’s the current graphs value & right show the value of y-axis show the value of y-axis of the graph that was merged.

Correlate Graph : Plot the y-axis of two graphs against each other. The active graph’s y-axis becomes x-axis of merged graph.Y-axis of the graph that was merged becomes merged graph’s Y-axis.

Run-Time Functions : Ir_load_dll- Loads an external DLL. Ir_peek_events- Indicates where a Vuser script can be

paused.

Prepared By: Purvang Page 14

Page 15: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Ir_think_time- Pauses script executions to emulate think time.

Ir_continue_on_error- Specifies an error handling method. Ir_rendezvous- sets a rendezvous point in a Vuser script.

Command Line parsing Functions : Ir_get_attrib_double- Retrieves a double type variable used

on the script command line. Ir_get_attrib_long- Retrieves a long type variable used on

the script command line. Ir_get_attrib_string- Retrieves a string used on the script

command line.

What is the relation between Load Runner and topaz?

Topaz is mercury Interactive’s line of products and hosted services for monitoring applications after deployment to production.

The topaz products are built with Load Runner technology and use the same script recorder.

Script built for load testing with loadrunner can be used by topaz for monitoring without modification.

What is the difference between Load Runner and astra loadtest?

Astra Loadtest is another load test tool from mercury interactive built specifically for testing web applications. Relative to Load Runner it:

Supports only HTTP and HTTPS protocols Has less functionality Uses the VBScript scripting language Has a larger footprint Costs less Is easier to learn In that loadrunner supports web application plus much more, it is preferred tool for load

testing web application. The exception is if the load testers are non-technical or the load test projects budget is too limited to afford loadrunner.

Prepared By: Purvang Page 15

Page 16: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

What is the advantage of running the Vuser as thread ? VuGen provides the facility to use multithreading. This enables more Vusers to be run per generator. If the Vuser is run as a process, the same driver program is loaded into memory

for each User, thus taking up a large amount of memory. This limits the number of Vusers that can be run on a single generator. If the Vuser is run as a thread, only one instance of the driver program is loaded

into memory for the given number of Vusers. Each tread shares the memory of the parent driver program, thus enabling more

Vusers to be run per generator.

Load Runner Architecture:

Prepared By: Purvang Page 16

Page 17: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Load Runner works by creating Virtual Users who act like real time users on client software.

Script are recorded by using Vugen(Virtual User script generator).It generators c language script code.

By using controller we can design the scenarios. We can specify on controller how many virtual users u want to test the software. The loadrunner generators/injectors are started or stopped by using controller. During the run the status of each machine is monitored by controller.

Analysis graphs are divided into the following categories: Vuser graphs: Provide information about vuser states and other vuser statistics. Error graphs: Provide information about the errors that occurred during the load

test scenario. Transaction graphs: Provide information about transaction performance and

response time. Web resource graphs: Provide information about the throughput, hits per second,

HTTP response per second, number of retries per second, and downloaded pages per second for web Vusers.

Web page diagnostics graphs: Provide Information about the size and download time of each web page component.

System resource graphs: Provide statistics relating to the system resource that were monitored during the load test scenario using the online monitor.

Hit per second:

Prepared By: Purvang Page 17

Page 18: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Running Vuser graph:

Transaction Response time:

Prepared By: Purvang Page 18

Page 19: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

Connection per second:

Prepared By: Purvang Page 19

Page 20: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

How do you write write user defined function in LR ? Give me few function you wrote in your previous project? Before we create the user defined functions we need to create the external library

(DLL) with the function. We add this library to vugen bin directory. Once the library is added then we assign user defined function as a parameter. The function have the following format: _declspec char*<function

name>(char*,char*). Examples of user defined function are as follows: Get version, Get currentTime, Get

Perform are some of the user defined functions used in my earlier project.

Transactions: To Measure the performance of the server, you define transactions. A transaction represents an action or a set of actions that you are

interested in measuring. You define transactions within your Vuser script by enclosing the

appropriate sections of the script with start and end transaction statements.

For example, you can define a transaction that measures the time ti takes for the server to process to view the balance of an account and for the information to be displayed at the ATM.

Filtering and sorting : We can filter the information display only those items that meet

the selected criteria (filter box). Exam you can filter Vuser only those who are in ready state. In sorting we can sort all the Vuser in the Vuser list. In order Vuser

ID(1,2,3,4,5,6,7,8,9).

What is the advantages of using Load Runner : 1. Load Runner automatically records the performance of the client/sever during

test.2. Load Runner checks where performance delays occur network/client delays.

Prepared By: Purvang Page 20

Page 21: api.ning.comapi.ning.com/.../LoadRunnerPurvang.docx  · Web viewLoad Runner . Load Runner scripting is user as a performance testing tool. Load runner scripting runs stress test

3. Load Runner monitor the network and server resource to help the improve performance.

Load Runner :Load Runner is a performance and load testing product by HP for

examining system behavior and performance, while generating actual load.

Load Runner can emulate hundreds or thousands of concurrent users to put the application through the rigors of real-life user loads( for

which it virtual User Generator ), while collecting information from key infrastructure components (Web servers, database servers etc ).

The Load Runner scripts are run via Controller, and after the results can then be analyzed in detail (using Analyzer), to explore the reasons

for particular behavior.

The Load Runner scripts are prepared with the help of click stream documents and webex Recording.

Click Stream Documents:Click stream documents are prepared for documenting the

flow of a transaction of the various screens involved to complete the transaction, input data to be given, and

indications to start and stop the timer.

WebEx Recordings:WebEx recordings are prepared using WebEx recorder which can

be easily downloaded from internet.In this we start the recorder and open the application in the

recorder records every action we perform.There are no indications to start or stop the timer and intelligence

is demanded from the coder itself.

Prepared By: Purvang Page 21