balasai lr

Download Balasai LR

Post on 24-Oct-2014




5 download

Embed Size (px)


Load Runner 9.51. 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


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,, 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

CorrelationIt 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



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 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 FunctionsUse 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


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 HandlingUse 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=", "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 h