balasai lr

36
Load Runner 9.5 1. New Features in LR 9.5 2. It supports for vista OS 3. It provide protocol advisor 4. It provides WAN Emulator 5. It provides Array functions like Lr_paramarr_random(); Lr_paramarr_idx(); Lr_paramarr_len(); Components in Load Runner: 1. Virtual User Generator: It is used to generate v-users script for the identified business scenarios 2. Controller: In this component we will design & execute the multi User test executions. 3. Analysis: It helps to analyze with test execution results with expected behaviors 4. Load Generator (LG): It generates the amount of V-Users load to run on the server. 5. Agent Process: It establishes a communication between Load Generator and Load Controller. Agent Process Load Gen1 Load Gen 2 Application Architectures Client Web Server Application Server Data Base 1. Stand alone/Desktop: Only Client Ex: MS Word, MS EXCEL etc 2. Client/Server: Client-Data Base Ex: Railway Reservation, Bus ticket Reservation etc 3. Web Application: Client-Web server-App Server-DB Virtual Users Generator Controlle r Server

Upload: yakamasai

Post on 24-Oct-2014

108 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Balasai LR

Load Runner 9.5

1. New Features in LR 9.52. It supports for vista OS3. It provide protocol advisor4. It provides WAN Emulator5. It provides Array functions like Lr_paramarr_random(); Lr_paramarr_idx(); Lr_paramarr_len();

Components in Load Runner:1. Virtual User Generator: It is used to generate v-users script for the identified business scenarios2. Controller: In this component we will design & execute the multi User test executions.3. Analysis: It helps to analyze with test execution results with expected behaviors4. Load Generator (LG): It generates the amount of V-Users load to run on the server.5. Agent Process: It establishes a communication between Load Generator and Load Controller.

Agent Process

Load Gen1

Load Gen 2

Application Architectures

Client Web Server Application Server Data Base

1. Stand alone/Desktop: Only Client Ex: MS Word, MS EXCEL etc2. Client/Server: Client-Data Base Ex: Railway Reservation, Bus ticket Reservation etc3. Web Application: Client-Web server-App Server-DB

Web Server APPLICATION SERVERS1. It executes all the requests which are

coming through Http communication using GET Method

1. It executes all the request which are using POST method

2. It executes all the static requests like HTML,JSP,ASP

2. It runs the business logic using available compiler for servers EJBS, Asp.net, C#.Net.

Web APP Data BaseIIS, Tomcat, Samba JBOSS, Web logic, Web sphere Oracle, SQL Server, My SQL DB2Protocol: it is a communicator to communicate between load runner and Application

Protocol Advisor: It is a newly added feature in LR 9.5 and it detects the supported protocol in our application business process

Virtual Users Generator (Script-C)

Controller

(Multi User)

Server

Page 2: Balasai LR

Dt: 07.09.2011Recording Modes: The LR supports 2 types of recording modes for web protocol.

1) HTML2) URL

1) HTML 2)URL1. It identifies web v-user functions for

each user action on a web page1. It identifies separate web_url functions for

each image on a web page2. Lines of code is less as it captures only

one web function for each user action2. Lines of code is more as it captures

multiple web function for each user action3. It takes less time to execute each user

action3. It takes more time to execute each user

action4. It identifies the recording mode as

HTML4. It identifies the recording mode as HTTP

Note:1. For plain html content of web pages we will always go with html-type of recording2. For the image downloading action we will always go with URL based recording

Correlation

It is a process to handle the data which is generated by the server dynamically

There are 2 types of correlation methods that are available in LR

1. Manual Correlation Parameters2. Automatic Correlation Correlation

Manual Correlation: Handle the server generated data by following the below steps is called ~.

1. Identify the server generated data in the scriptGenerate the 2 identical business scriptsGo to –Tools-compare with scriptSelect another script for the comparisonThe 2 steps comparison will display under WDIFF UtilityFind out the differentiated correlated value in the comparison

2. Capture new set of server generated dataUse the below correlation function to capture the new set of server generated dataWeb_reg_save_Param(“PNAME”,”LB=”,”RB=”,”ORD=”,LAST);web_reg_save_param("Session", "LB=value=", "RB=>", "ORD=1", LAST);

Copy the identified correlated value in the scriptSearch the corresponding copied value in server response of previous request.Identify the Left Boundary and Right Boundary values of the corresponding correlated valueIdentify ordinal number (ORD) between the given Left and Right boundaries.Insert the correlation function with all the arguments.

Client Server

Page 3: Balasai LR

3. Save captured value in to a variableWe need to save the value into a separate variable when we use “ORD=ALL”.

4. Replace the variable at all the places of old value in the script.Note: When you replace the variable at all the places of old value it should be placed within flower brackets {}"Name=userSession", "Value={Session}", ENDITEM,

Array Functions

Use the below types of array functions to select one array or index value from the list of values using ORD=all

1. Lr_paramarra_idx(arrayparameter,indexvalue ): It selects a specific index value from the list of array valueEx : temp=lr_paramarr_idx("Session",i);

2. Lr_param_random (“session”):It select one random value from the list of array values

Automatic Correlation

Handle the correlated date with the help of tool functionalities is called ~

1. Scan script for correlation: Use ~ to do the automatic correlation after recording of the script.2. Using a correlation rule: Create a correlation rule with all the arguments(lb,rb,ord) in recording

options so it will automatically handle the correlated data at the time of during script recording itself

Note :Use the below function to update the length of the correlated parameter

//web_set_max_html_param_len("1024");

*** web_reg_save_param("WCSParam2", “LB/IC=userSession value=", "RB/IC=>", "Ord=1", "Search=Body","RelFrameId=1.2.1", LAST);

By default length of the correlated parameter(WCSParam2)r is 256 bytes.

Page 4: Balasai LR

Check Point

To validate the data on the webpage use ~ as below

1. Text Check Point: Use the below types of text check points to validate the text on a web page

i) web_reg_find() ii) Web_find()a) It is a type of text check point to

verify the text on a web pagea) It is a type of text check point to

verify the text on a web page

b) It will automatically record by enable generate web _reg_find functions for page titles in record settings

b) We need to insert this function by manually with the corresponding text on a web page

c) This function should be placed before the http request

c) This function should be placed after the http request

d) No need to enable any options to verify the text at run time

d) We need to enable image and text check to verify the text at run time

e) Syntax: web_reg_find(“test=password”,”SaveCont=Test1”,Last)

e) Web_find(“TextCheck”,”What=password”,Last);

iii) Web_global_verification:It is a global verification text check point to verify the text on all the web pages.Syntax: web_global_verification("Text=to","Fail=Notfound",LAST);Note: Without using a global verification text check point we can verify the text on all web pages using Context check option in Runtime settings

2. Image Check Point:

Page 5: Balasai LR

Parameterization

It is a process to handle the data which is passing as a user Inputs.

Parameterization

Client Server

Correlation

Objective: To simulate the behavior of the script equivalent to the real users by passing the different set of user inputs.

Parameter File(Porperties/Options)

1. Sequential: The new parameter value will be updated by sequential (Default starts from 1)2. Random: The new ~ parameter value will be updated for each script execution.3. Unique: The new ~ parameter value will be updated for each script execution.

Each Iteration: The new parameter values will be updated for each iteration of the script execution.Each Occurrence: Update the new parameter values for each occurance of the parameter file used in the script Note: Same value will be replaced when ever this parameter is called in the script.Ex: Same Account no will be replaced when ever this declared parameter is called in the script.Once: A single parameter value will be assigned for all the iteration done by each v-user.Use Case: Design the scenario for 10 vusers with 10 iterations having 100 records in the file.

Sequential -----Each Iteration

Sequential ------Once

Page 6: Balasai LR

Random ---Each Iteration

Random --- Once

Unique---Each Iteration

Unique----Once

Page 7: Balasai LR

Multi Column Data Files:-

Select the CSV file (Common separated values) with multiple columns to pass the data for all the parameters using a single file.

Same Line As:-

Select this option to pass the same line of the parameter value based on the select parameter Row

Eg:

(Note the user name should pass corresponding passwords only)

Unique Features:

When you use unique parameter option follow the below 2 standards.

1. Parameter File Size= no of vuser * no of iterations.2. Block Size for each vuser based on the no. of Iterations.

User Name PasswordSa101 AbcdSa102 EfghSa103 IjklSa104 monp

Page 8: Balasai LR

Array Functions

Lr_paramarr_random(“ssss”);

Lr_paramarr_idx()

Lr_paramarr_len();

Note:

All the above array functions are available from LR 9.5 Version so in earlier functions of LR we use the below functions for array handling

Instead of SaveCount in web_reg_find we use this function is web_get_int_property

web_get_int_property(HTTP_INFO_RETURN_CODE);

Use this function to measure the behavior of previous HTTP request

HTTP_INFO_RETURN_CODE:-It returns the status code of the previous HTTP Request

HTTP_INFO_DOWNLOAD_SIZE:-It shows the amount of bytes has been downloaded for the previous http request

HTTP_INFO_DOWNLOAD_TIME:-It shows the time taken to execute the previous HTTP request.

Page 9: Balasai LR

Error Handling

Use save count argument in web_reg_find text check point to handle the errors at run time

Ex:web_reg_find("Text=\r\n\tWelcome to Online Shopping\r\n", LAST);

web_url("onlineshopping",

"URL=http://192.168.1.43/onlineshopping/",

"TargetFrame=",

"Resource=0",

"RecContentType=text/html",

"Referer=",

"Snapshot=t1.inf",

"Mode=HTML",

LAST);

if(atoi(lr_eval_string("{Test}"))>0)

{

lr_output_message("Home Page Downloaded Succesfully");

lr_end_transaction("WebTours_TicketBooking_01_HomePage", LR_PASS);

}

else

{

lr_error_message("Home Page Downloading Failed");

lr_end_transaction("WebTours_TicketBooking_01_HomePage", LR_FAIL);

lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE,LR_FAIL);

}

Page 10: Balasai LR

DYNAMIC BOUNDARY HANDLING

Whenever we observe the boundaries are dynamically changing use the below methods to handle that kind of scenarios.

Text Flags

Use the below 2 types of ~ to handle the DYNAMIC BOUNDARY values

1. DIG: When we observe the dynamic boundary characters are digits then use DIG text flag and replace with # at each place of dynamic digit

Ex://option value=”6”>6</option>In the above example I wanted to capture the list of months using a common boundaries but, I observe in the left boundary one digit is dynamically changing. So I use the correlation function as below

Note:In the above left boundary I observed the dynamic digit is 6 which is dynamically changing.2. ALNUM---^:-

When we observe the dynamic boundary values are combination of alphanumeric then use ALNUM text flag and replace with symbol ^ at each place of dynamic character.Ex:-//<option value = “abcd6>6</option >

In the above example I observed the dynamic characters are abcd6 in Lt Boundary so I use the function o as

Web_reg_save_param(“startmonth”,“LB/ALNUM=<option value = “abcd6>”,“RB=</option >”,“ORD=ALL”,LAST);

Save Length & Save OFF Set:-

(It handles both dig alphanumeric as well as special characters)

Use the below 2 arguments in correlation function to handle the dynamic boundaries.

Page 11: Balasai LR

Ex:- :-//<option value = “2010>20106</option >

Web_reg_save_param(“startmonth”,“LB/ALNUM=<option value = “abcd6>”,“RB=</option >”,“ORD=ALL”,“Savelen=4”,“Saveoffset=6”,LAST);

Note:- In the above example I define constant LtBoundary and RtBoundary and in between 2 boundaries captures a value and save the length of the correlated value using Savelen arguments.

Saveoffset: It defines the no of characters to be ignore which is dynamically changing from the beginning of captured value.

Savelen: It defined the no.of characters to be saved in to the given parameter as a correlated value.

4Pages space for scripting parts

Page 12: Balasai LR
Page 13: Balasai LR

Controller

It is used to design and execute the multiuser load scenarios. (Notes)

Performance Testing Types

Smoke Test: - Test the behavior of

Load Test: - Test the behavior of an application with the expected vusers load on server

Scenario Name Vuser Load Ramp Up Steady State Ramp DownDD Request 300 1 vuser for 3 sec 60 Min Simultaneously

Funds Transfer 300 1 vuser for 3 sec 60 Min SimultaneouslyHome Loans 200 1 vuser for 5 sec 60 Min SimultaneouslyStatements 200 1 vuser for 5 sec 60 Min Simultaneously

Endurance Testing:- Test the behavior of an application in a prolong duration

Ex:- 6hrs-12hrs-48hrs-1 week.

Scenario Name Vuser Load Ramp Up Steady State Ramp DownDD Request 300 1 vuser for 5 sec 10 Hrs Simultaneously

Funds Transfer 300 1 vuser for 5 sec 10 Hrs SimultaneouslyHome Loans 200 1 vuser for 10 sec 10 Hrs SimultaneouslyStatements 200 1 vuser for 10 sec 10 Hrs Simultaneously

Stress Testing: - Test the behavior of an application by gradually increasing the load on server until the application crashes or environment breaks

Application Level Stress: - we can do the ~ using the below methods

1. Increasing the vusers load until the application crashes or environment break downs2. By reducing the think time & pace time3. By reducing the H/W configuration in all the servers.

Functional Level Stress: - Do this stress on a particular functionality using a Rendezvous point.

Spike Testing:- (Suddenly increasing or decreasing the load without planning)

Test the behavior of an application with the dynamic workloads changes at work time (either increase/Decrease)

Fail over Test:- Whenever the application is configure in to multiple web servers identify the behavior of the load balancer, if any sever fails in middle of the execution

Page 14: Balasai LR

Client 1

Client 2

Client3

.

.

.

Load Balanc Server

Web server1Web server2Web server3Web server4Web server5

Page 15: Balasai LR

Analysis

Analyze all the performance metrics to identify the performance bottlenecks at client side and at server side.

1. Client side matrix analysis:

Analyze the below types of client side matrix to identify the performance bolted neck

Response Time: It measures end – end time taken to execute each user action.Response Time=Client Time +Server Time + Network Time.Unit = Seconds.

Analyze each transaction response time with given SLA (<=5 sec).

SLA is also called as Pass/fail Criteria or Exit Criteria.

90 th Percent: Analyze the response time of each transaction at 90th Percent Column values to identify the behavior of each transaction response time

90 th Percent Steps:

1. Generate the raw data on average transaction response time graph.2. Sort all the transaction response time in ascending order 3. Calculate the 90th % transaction count based on passed transactions.4. Find out the response time at 90th % transaction count.

We can recommend to the client 90% of the users or transactions can get this will be the highest response time where are average values are not accurate.

PASS CRITERIA: Whenever we observe the 90th % transaction response time values are within the SLA (<=5 sec) we conclude that it meets the response time SLA.

Fail Criteria: Whenever you observe the 90th % transaction values are out of SLA’s find out the Root Cause of response time failures for each transaction in execution

Page 16: Balasai LR

System Level Issues

Memory

1. Available MB- It is the amount of physical memory which is available for running the processes.

2. Committed Bytes- It is the Virtual Memory (It should be in the ratio of1:1.5)3. Page Faults/Sec--It is the no of pages fault per second. This fault will occur because of

2 reasons a) Hard Fault b) Soft FaultNote: Total Page fault/Sec=Hard Fault+ Soft Fault

4. Page Read/Sec It is the time which required for a single page to read by the Virtual Memory.

5. Pages Input/Sec It is the required time for pages to read by the Virtual Memory.Note: Hard Fault/Sec= Page Read/Sec + Pages Input/Sec

6. Page Write/Sec It is the time which required for a single page to write by the Virtual memory.

7. Pages Output/Sec It is the required time for pages to write by the Virtual Memory.Note: Soft Fault/Sec= Page write /Sec + Pages Output /Sec.

8. Pages/SecRate at which Pages Read and Write to resolve the hard fault.9. Pool/Non Paged BytesNo of bytes pooled from Non-Paged Bytes.10. Pool/Paged Bytes No. of bytes used from Paged Bytes.

Physical Disk

Avg.Disk Read Queue Length: Average no. of requests waiting in queue for read operationAvg.Disk Write Queue Length: Average no. of requests waiting in queue for write operation

Processor

1. %Idle Time: System is idle2. %Privileged Time: Time taken to execute System file3. %Processor Time: System working time4. %User Time: Time taken to execute user operations

SystemProcessor Queue Length: It is the no. of request queue waiting for each single processorTCPConnection Failures: As the no of errors occurs in the script the connection fails establishConnection Active: As the script is executing the no of connections increasing the connection active also increases.Connection Establish: No o f TCP connections established during the load test execution

Page 17: Balasai LR

2. Hits /Second: It shows the no of requests are made by client to web server /sec in the execution.

Note: Communication is only between the client and web server

SLA Not applicable

Observation: I observed the hits/sec in the execution graphs as 145.966.

Note:

1. To increase the Hits/Sec in the execution with the same scenario we will reduce the think time and the pace times.

2. To reduce the hits/sec rate in the execution with the same scenario we will reduce the think time and the pace times.

3. Through Put : (Bytes) it measures the amount of data which transfer from client to web server and from web server to client.

Note: If there is no web server then there is no concept of hits/sec and through put.SLA: It can be utilize maximum of 80% of total bandwidth.

Total Configured Bandwidth: By default the bandwidth is 100MbpsTransaction per Second: Analyze the transaction rate per second with the expected users load

1yers 52 weeks 1week 5 working days 2 day 8 working hours 1hr 60 min 1min 60 sec

TPSAnalyze the transaction rate per second for each transaction with the expected vusers loadNote:

1. To increase the TPS rate with the same configuration settings reduce the Think time and Pace time

Page 18: Balasai LR

2. To decrease the TPS rate with the same configuration settings increase the Think time and Pace time

Vuser Log Analysis:

Analyze the each vuser log to find out the root cause of user failed in the execution

1. Analyze the failed user snapshots to find out the root cause of user fail during the execution in v-user log by enabling generate snapshot on error in run time settings during the execution

2. Analyze the detailed log level information of failed users in captured log file by enable log options in runtime settings during the load test.

Transaction Pass/Fail Criteria:

The acceptable user failure rate in the execution as 5% of the total user in the execution.

Data Base Matrix

Free space scanFull scanLezy writesNo of dead locksBuffer cache iteration

Page 19: Balasai LR

System Level Matrix

Windows OS

Page 20: Balasai LR
Page 21: Balasai LR

UNIX

Web Logic Server Matrix

IIS Server Matrix

Page 22: Balasai LR
Page 23: Balasai LR

Servers

Server: It is a centralize unit ot receive the request, process and Release the response.

1. Web server 2. App Server3. DB Server

Web Server:

1. It executes all the http request which are using Get Method.2. It executes the static request like HTML, JSP, ASP, PHP.

APP Server:

1. It executes all the kind of business logics using available compilers.2. I t provides a database connection using either JDBC or ODBC connection pool

a. JDBC: (Java Database Connection) It provides a Data Base connections from the connection pool for Java Based Applications

b. ODBC(Open Database Connection) It provides a Data Base connections from the connection pool for all non Java Based Applications

Data Base:

It maintains the DB information about the application and we can manuplicte the data as per the application demands.

Web App DBIIS OracleWeb Logic Sql ServerWeb Sphere My SqlTomcat DB2Jboss CybaseIplanetSambaiPramati

Web APP

IIS IIS -------------------Java

IIS Web Logic -----------DotNet

Web Logic Web Logic -----Java

Web Sphere Web Sphere

Tomcat -

- Jboss

Samba

- Pramati

Page 24: Balasai LR

Web Logic Server

JVM

It is a type of component in java to handle dynamic memory at runtime.

Garbage Collector (Component of JVM).

It will identify all UN used objects and remove them from the execution so that the corresponding allocated Heap memory also released at run time

GC Start

Sotp

1. GC life cycle starts a root node and transverse with all the sub nods to identify all un used objects in the execution

2. After end of every cycle it has to start the next cycle immediately to free up all used objects3. The developer might use system.gc function explicitly invoked in the execution to run it

throughout the server execution or server run time.

Memory Leaks

It is unavailability of heap memory during the test execution whenever the system is running with out- of memory.

Simple Def: Unreleased memory which is no longer needed is causing a memory leaks.

Heap Size Max: It shows the maximum heap memory configured into the JVMObservation: I observed the max heap memory configured in JVM is 508 MB almost equal to 512 MB.Heap Size Current: It shows he current amount of Heap memory that is ready to use for new object creationsHeap Free Percent: It shows the percentage of free heap memory at runtime from the total size currentHeap Used % =heap size current%- Heap Free %So Heap Used % = 435MB(100%)-20%

=80%

Page 25: Balasai LR

Observation: I observed the Heap free percent was dynamically changing from highest % to lowest % and vice versa.So that I can conclude the Garbage Collector lifecycle is successfully running throughout the test execution. So there were no memory leaks observed during.JDBCIt shows the JDBC connections statistics during the execution.

1. Active Connections Average Count:It shows the average connection of active count till the given time duration

2. Active Connections Current count: It shows the current amount of JDBC connections which are in ACTIVE at any point of time in the execution.

3. Connection Total Count:

Page 26: Balasai LR

Pre requests or Preconditions for any test execution

1. Design the scenario with all the configuration settings.2. Reset all the web or application servers.3. Reset the Database Instances which will impact the applications

functionalities.Ex: In my application I have done some basics of DB activities to reset the data for Loans and card applyOnce we apply for loans and cards again we cannot reapply with the same acc no. So we had to reset the data before each execution, to reuse the same data.For donning the online transactions we need to maintain sufficient balance in all the accounts. Update the sufficient amount commonly for the entire acc.

SQL Profiler

SQL SEVER PROFILER: it uses to get the query performance and execution time …etc.File –new trace----click runIt provides the query level statistics at run time as below

1. Query String.2. CPU – It shows the % of CPU utilization to execute each query3. Read- It shows the no of page read operation to run each stored

procedure.4. Write- It shows the no of page Write operation to run each stored

procedure.5. Duration: It shows the time taken to execute each query in

milliseconds.

Page 27: Balasai LR

Graph Comparison:

Vuser Hits/Sec

Through Put Response Time

TPS Processor Available Memory

Vuser N/A Incr Incr Incr Incr Incr DecreaseHits/sec N/A N/A Incr Incr Incr Incr DecreaseThroughPut

N/A N/A N/A Incr Incr Incr Decrease

Response Time

N/A N/A Direct/ Indirect

N/A Dir/ Indi

Incr Decrease

TPS N/A N/A Direct/ Indirect

Incr N/A Incr Decrease

Processor N/A N/A N/A N/A N/A N/A DecreaseAvailable Memory

N/A N/A N/A N/A N/A N/A N/A

Page 28: Balasai LR

Oracle Server Counters

1. User I/O wait time2. Transactions Rollbacks3. Table scans(short tables & Long tables)4. Session Connect time.5. Physical write total io request6. Physical read total io request7. Index scans8. Free buffer requested.9. CPU used by this session