Balasai LR

Download Balasai LR

Post on 24-Oct-2014

84 views

Category:

Documents

5 download

Embed Size (px)

TRANSCRIPT

<p>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();</p> <p>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 &amp; 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</p> <p>Server</p> <p>Application Architectures Client Web Server Application Server Data Base</p> <p>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.</p> <p>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</p> <p>Dt: 07.09.2011 Recording Modes: The LR supports 2 types of recording modes for web protocol.</p> <p>1) HTML 2) URL 1) HTML 2)URL</p> <p>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</p> <p>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</p> <p>Client</p> <p>Server</p> <p>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</p> <p>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=&gt;", "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.</p> <p>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,</p> <p>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</p> <p>Automatic Correlation</p> <p>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=&gt;", "Ord=1", "Search=Body","RelFrameId=1.2.1", LAST); By default length of the correlated parameter(WCSParam2)r is 256 bytes.</p> <p>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);</p> <p>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:</p> <p>Parameterization It is a process to handle the data which is passing as a user Inputs. Parameterization Client Correlation Server</p> <p>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</p> <p>Sequential ------Once</p> <p>Random ---Each Iteration</p> <p>Random --- Once</p> <p>Unique---Each Iteration</p> <p>Unique----Once</p> <p>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.</p> <p>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)</p> <p>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.</p> <p>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.</p> <p>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=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}"))&gt;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);</p> <p>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&gt;6 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</p> <p>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:-//6 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=, RB=, ORD=ALL, LAST); Save Length &amp; 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.</p> <p>Ex:- :-//20106 Web_reg_save_param(startmonth, LB/ALNUM=, RB=, 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.</p> <p>4Pages space for scripting parts</p> <p>ControllerIt is used to design and execute the multiuser load scenarios. (Notes)</p> <p>Performance Testing TypesSmoke 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</p> <p>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</p> <p>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 &amp; 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</p> <p>Client 1 Client 2 Client3 . . .Load Balanc</p> <p>Web server1 Web server2 Web server3 Web server4 Web server5</p> <p>Server</p> <p>Analysis</p> <p>Analyze all the performance metrics to identify the performance bottlenecks at client side and at server side.</p> <p>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 (</p>