load runner training

18
Load Runner Training – Day 1 Load Runner – Testing tool of Mercury Interactive (now HP)

Upload: rakesh-reddy-geetla

Post on 24-Oct-2015

42 views

Category:

Documents


1 download

DESCRIPTION

HP Load Runner tool TutorialArchitecture of Load RunnerPerformance testing document

TRANSCRIPT

Load Runner Training – Day 1

Load Runner – Testing tool of Mercury Interactive (now HP)Performance testing tool

Checks the Speed and efficiency of a system or application

If 1 user takes 5 sec to access a websiteNow, if 50 users try to access the same website, the time taken should be the same

Types of Performance Testing: Load testing – verify the maximum capacity of an application Stress testing – identify the breaking point of an application

Load testing: If an application is used by 5 users, install LR in one main system, create 5 virtual users.

Virtual User – tool or machine generated usersLoad Runner can be used for both Web-based and windows-based application

Scripting languages used:

TSL (test script language) C Java Script

Load Runner is an expensive tool: (License period – 8 months) 25 VU $16,000 50VU $22,000 100VU $33,000

Comparison between Opensta and LR

Load Runner is a licensed tool.Opensta (free-source tool) can be downloaded from www. opensta .org or www.cyrano.org

Load Runner is mainly used by companies’ because Enterprise Tool – a tool that can be used to test applications developed in any programming language.

a. Technology Independent tool Follows Protocol (set of rules to be followed by client/server for the transaction of data between each other)

Load Runner can be used for both Web-based and windows-based applicationOpensta is used for HTML based websites.

PROTOCOL – set of rules to be followed by a website.

HTTP – (Hyper Text Transfer Protocol) – a basic protocol used for client-server interaction (followed by most websites). SMTP – (Simple Mail Transfer Protocol) – a protocol used by a website to allow sending/receiving mails. FTP – (File Transfer Protocol) – a protocol used for upload/download files to/from a website. NTP – (News Transfer Protocol) – a protocol used for view news updates through a website.

Multi-protocol based website – a website that follows all the protocolsLoad Runner can be used to test MULTI-protocol based website Opensta can be used to test UNI-protocol based website

Components of Load Runner: VUGEN CONTROLLER SCHEDULER

VUGEN: Virtual User script GENerator used to create scripts

1 website 10 Virtual Users 5 web pagesCreate a script Record/Capture the URL of 5 web pages Create 10 Virtual Users using VUGEN

CONTROLLER:It is a Central Component (Heart) of Load Runner. It is used to generate Virtual Users.

SCHEDULER:It is used to schedule the tasks of the script and virtual users.

Mercury Load Runner 8.0 Free Trial Version: 10 days License period

Load Runner generates script in two formats: Tree-View (Hierarchical format) Expert-View (Script-View or Paragraph format)

To view all activities during playback Tools Display Options Show Browser during Display

The script is divided into three parts in Load Runner: The left panel has three options:

vuser_init Action vuser_end

In a client-server mechanism, Client sends a request (req1) to the server to establish a connection. The server sends a response (res1) vuser_init Client sends a request (req2) to the server to access some web pages. The server sends a response (res2) Action (contains code) Client sends a request (req2) to the server to terminate the connection. The server sends a response (res3) vuser_end

web_URL refers the URL of the home page to be accessedweb_link refers the following web pages to be accessedlr_think_time specifies the time gap between two consecutive web pages to be downloaded

Controller path

Scenario Combination of Script and Virtual Users

Default No of Virtual Users in Load Runner 10

Group Name Name of the group of the Virtual UsersScript path path of the scriptQuantity No of Virtual UsersLoad Generators System where the script is running or where virtual users are created (local or remote)

In Controller, we have two different components, Design Component used to modify the scenario Run Component used to execute the scenario

Elapsed Time time taken by the script (all the virtual users) to execute the run.

Design Components of Controller: Start Scenario helps to start the execution of the scenario Generators used to connect the remote host with the local host Vusers to allow some/any virtual user to take command of the scripting

Host sharing a process of making the remote host generate virtual users for the application.

Generators used to connect the remote host with the local host

Add Group to add another/more group of virtual users

Details view a short description of the script/scenario

View Script display the script for which the scenario has been created

Run-Time Settings

Scenario Groups: Different status of the VU’s Down script is assigned to the virtual user but not executed Pending the virtual users request the allocation of 4 bytes of memory to the system Init memory has been allocated Ready VU’s are ready to execute the script Run Executing the script Passed Successful execution of the script/scenario Failed Unable to successfully execute the script/scenario Error Unable to execute the script/scenario partially/completely due to problem in Script, Network or Server Issue Gradual Exiting Exiting from the scenario for individual virtual user Exiting Complete exit from the scenario Stopped Completion of the script/scenario, De-allocation of the memory

Test Manager A Load Runner Component responsible for allocation of memory for the virtual users.

A script/scenario requires 10 virtual users to access a website (5 web pages) with 40 bytes of memory.The Test Manager requests the System to allocate 40 bytes System returns 36 bytes The command is sent back to the script.

Elapsed Time Time taken by the script for executionHits/Second No. of requests made by the client to the server

Transaction = Request + Response

Load Runner scripts are saved with an extension *.usr

lr_start_transaction(“t1”) a function to start a timer, with a single argument as the name of the timer

lr_end_transaction(“t1”, LR_AUTO) a function to stop the timer, with two arguments, the name of the timer and the condition to end the timer.

LR_AUTO logs time when the transaction is terminatedLR_PASSED logs time when the transaction is passedLR_FAILED logs time when the transaction is failed

Difference between Controller & Vugen approach:Memory Allocation & De-Allocation Time 17 seconds

Rendezvous point stopping point or waiting point of a virtual userIt is used to perform an exact Load testing of an application.

It has to be inserted before a particular web page. It is present in “Insert” menu bar.

Fomrat lr_rendezvous(“ren”)

For rendezvous point, we have three policies in a controller Release when 100 % of all Vusers arrive at the rendezvous Release when 100 % of all running Vusers arrive at the rendezvous Release when 100 Vusers arrive at the rendezvous

The first policy should be used if the rendezvous point has to be before the part of the script accessing of the first web page The second policy should be used if the rendezvous point has to be at any part of the script