Sie sind auf Seite 1von 28

Load Runner 9.

5
1. 2. 3. 4. 5. New Features in LR 9.5 It supports for vista OS It provide protocol advisor It provides WAN Emulator It provides Array functions like Lr_paramarr_random(); Lr_paramarr_idx(); Lr_paramarr_len();

Components in Load Runner:


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

Server

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 Web Server 1. It executes all the requests which are coming through Http communication using GET Method 2. It executes all the static requests like HTML,JSP,ASP APPLICATION SERVERS 1. It executes all the request which are using POST method 2. It runs the business logic using available compiler for servers EJBS, Asp.net, C#.Net.

Web APP Data Base IIS, Tomcat, Samba JBOSS, Web logic, Web sphere Oracle, SQL Server, My SQL DB2 Protocol: 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

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

1) HTML 2) URL 1) HTML 2)URL

1. It identifies web v-user functions for 1. It identifies separate web_url functions for each user action on a web page each image on a web page 2. Lines of code is less as it captures only 2. Lines of code is more as it captures one web function for each user action multiple web function for each user action 3. It takes less time to execute each user 3. It takes more time to execute each user action action 4. It identifies the recording mode as 4. It identifies the recording mode as HTTP HTML Note: 1. For plain html content of web pages we will always go with html-type of recording 2. 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 2. Automatic Correlation Parameters Correlation

Client

Server

Manual Correlation: Handle the server generated data by following the below steps is called ~. 1. Identify the server generated data in the script
Generate the 2 identical business scripts Go to Tools-compare with script Select another script for the comparison The 2 steps comparison will display under WDIFF Utility Find out the differentiated correlated value in the comparison

2. Capture new set of server generated data Use the below correlation function to capture the new set of server generated data Web_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 script Search the corresponding copied value in server response of previous request. Identify the Left Boundary and Right Boundary values of the corresponding correlated value Identify ordinal number (ORD) between the given Left and Right boundaries. Insert the correlation function with all the arguments.

3. Save captured value in to a variable We 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 value Ex : 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.

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 a) It is a type of text check point to verify the text on a web page 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 c) This function should be placed before the http request d) No need to enable any options to verify the text at run time e) Syntax: web_reg_find(test=password, SaveCont=Test1,Last) iii) b) We need to insert this function by manually with the corresponding text on a web page c) This function should be placed after the http request d) We need to enable image and text check to verify the text at run time e) Web_find(TextCheck,What=p assword,Last);

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:

Parameterization It is a process to handle the data which is passing as a user Inputs. Parameterization Client Correlation Server

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

Random ---Each Iteration

Random --- Once

Unique---Each Iteration

Unique----Once

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: User Name Sa101 Sa102 Sa103 Sa104 Password Abcd Efgh Ijkl monp (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.

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.

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", 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); } LAST);

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.

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

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 DD Request Funds Transfer Home Loans Statements Vuser Load 300 300 200 200 Ramp Up 1 vuser for 3 sec 1 vuser for 3 sec 1 vuser for 5 sec 1 vuser for 5 sec Steady State 60 Min 60 Min 60 Min 60 Min Ramp Down Simultaneously Simultaneously Simultaneously Simultaneously

Endurance Testing:- Test the behavior of an application in a prolong duration Ex:- 6hrs-12hrs-48hrs-1 week.
Scenario Name DD Request Funds Transfer Home Loans Statements Vuser Load 300 300 200 200 Ramp Up 1 vuser for 5 sec 1 vuser for 5 sec 1 vuser for 10 sec 1 vuser for 10 sec Steady State 10 Hrs 10 Hrs 10 Hrs 10 Hrs Ramp Down Simultaneously Simultaneously Simultaneously 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 downs 2. By reducing the think time & pace time 3. 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

Client 1 Client 2 Client3 . . .


Load Balanc

Web server1 Web server2 Web server3 Web server4 Web server5

Server

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. 90th Percent: Analyze the response time of each transaction at 90th Percent Column values to identify the behavior of each transaction response time 90th Percent Steps: 1. 2. 3. 4. Generate the raw data on average transaction response time graph. Sort all the transaction response time in ascending order Calculate the 90th % transaction count based on passed transactions. 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 SLAs find out the Root Cause of response time failures for each transaction in execution

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 Fault Note: 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 operation Avg.Disk Write Queue Length: Average no. of requests waiting in queue for write operation Processor 1. 2. 3. 4. %Idle Time: System is idle %Privileged Time: Time taken to execute System file %Processor Time: System working time %User Time: Time taken to execute user operations

System Processor Queue Length: It is the no. of request queue waiting for each single processor TCP Connection Failures: As the no of errors occurs in the script the connection fails establish Connection 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

2.

Hits /Second:
the execution.

It shows the no of requests are made by client to web server /sec in

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 100Mbps Transaction 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 TPS Analyze the transaction rate per second for each transaction with the expected vusers load Note: 1. To increase the TPS rate with the same configuration settings reduce the Think time and Pace time

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 scan Full scan Lezy writes No of dead locks Buffer cache iteration

System Level Matrix Windows OS

UNIX

Web Logic Server Matrix

IIS Server Matrix

Servers Server: It is a centralize unit ot receive the request, process and Release the response. 1. Web server 2. App Server 3. 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 IIS Web Logic Web Sphere Tomcat Jboss Iplanet Sambai Pramati App DB Oracle Sql Server My Sql DB2 Cybase Web IIS IIS Web Logic Web Sphere Tomcat Samba Pramati APP IIS -------------------Java Web Logic -----------DotNet Web Logic -----Java Web Sphere Jboss

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 objects 3. 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 JVM Observation: 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 creations Heap Free Percent: It shows the percentage of free heap memory at runtime from the total size current Heap Used % =heap size current%- Heap Free % So Heap Used % = 435MB(100%)-20% =80%

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. JDBC It 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:

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 apply Once 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 run It provides the query level statistics at run time as below 1. Query String. 2. CPU It shows the % of CPU utilization to execute each query 3. 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.

Graph Comparison: Vuser Hits/ Sec N/A Incr N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A Through Put Response Time Incr Incr Incr Incr N/A Incr Direct/ Indirect Direct/ Indirect N/A N/A N/A Incr N/A N/A TPS Incr Incr Incr Processor Available Memory Incr Decrease Incr Decrease Incr Decrease Decrease Decrease Decrease N/A

Vuser Hits/sec Through Put Response Time TPS Processor Available Memory

Dir/ Incr Indi N/A Incr N/A N/A N/A N/A

Oracle Server Counters 1. 2. 3. 4. 5. 6. 7. 8. 9. User I/O wait time Transactions Rollbacks Table scans(short tables & Long tables) Session Connect time. Physical write total io request Physical read total io request Index scans Free buffer requested. CPU used by this session

Das könnte Ihnen auch gefallen