Performance Testing Using LoadRunner

Objective
‡ Understanding the issue involved in Load Testing of Web Applications. ‡ How to perform successful Load Tests using LoadRunner Tool.

Why Load Test your Web Application?
‡ The failure of a mission-critical Web Application can be costly. ‡ Assure Performance and Functionality under real world conditions. ‡ Locate potential problems before your customer do it.

Load Generator ² An agent through which  . starts and stops load tests. Assigns scenarios to Vusers and load generators.MajorScript Recorder of Load Testing components .  Controller .Records Vuser  Vuser scripts that emulate the actions of real users. maintaining and executing load test scenarios.Administrative center for creating.

What we can Monitor? ‡ ‡ ‡ ‡ ‡ Web Servers Web Applications Firewall Networks Database Servers .

How LoadRunner Works? Load Generator Machines .

when played back.Definitions ‡ Business Process: A user interacting with an application to accomplish a business tasks. ‡ LoadRunner Transaction: An end-to-end measurement of one or more user actions within an action (browser-to backend-to browser) . emulates a real user performing the same steps. ‡ Action: A recorded business process or series of steps that. ‡ LoadRunner Scenario: An Environment which describes all the elements to be used and the conditions under which you want to test your system.

. the script interacts with a Web application just like a real user. When played back. ‡ Checkpoints: A checkpoint is a step in a Vuser script which verifies whether a virtual cue appeared as expected. ‡ Rendezvous point (Optional): This point makes the faster users wait for the slower users. . ‡ Virtual User (Vuser): A virtual user is a script of recorded user actions.Definitions continues.

Process of Automated Load ‡ Testing Step 1: System Analysis Step 2: Creating Virtual User Scripts Step 3: Defining Users Behavior Step 4: Creating Load Test Scenarios Step 5: Running the Load Test Scenarios and Monitoring the Performance ‡ Step 6: Analyzing the Results ‡ ‡ ‡ ‡ .

Step 1: System Analysis . The objective is to determine whether the site can sustain this requested number of virtual users with acceptable response time.‡ Identify the Key performance goals and objectives before executing any scripts. ‡ Testers needs to define the input data used for the business process. ‡ Testers must define the appropriate strategy for load testing  Load Testing is used to test an application against a requested number of users.

Step needSystem the solid understanding of 1: to cultivate Analysis ‡ Tester system Architecture.  Routers used in Network  Multiple Servers  Load Balancers ‡ Tester must determine which resources are available to run the Vusers. .

.Step 2: Creating Virtual User ‡ Scripts Once a Business process has been identified for Load Testing we need to actually record the script using LoadRunner. ‡ Also we need to put in proper checks in the script to see that it runs as per the requirements of our application. and any intermediate errors are caught by our script. to a web browser. ‡ Once such a script is ready it needs to be run for two users to check concurrency issues. ‡ LoadRunner is able to map the mouse and keyboard inputs. into a script.

Step 2: Creating Virtual User Scripts Start Recording .

Step 2: Creating Virtual User Scripts Recording ToolBar .

Step 3: Defining User BehaviorRuntime Settings .

By varying think times for users.4 Kbps to 56.Step 3: Defining User BehaviorRuntime Settings ‡ Think time: Controls the speed at which the virtual user interacts with the system by including pauses of think times during test execution. . Modem speeds range from 14.6 Kbps. This is useful for controlling user behavior in order to accurately emulate response times for each request. ‡ Dial-up speed: Emulates a user connected to the system using a modem and/or LAN/WAN connections. LoadRunner can emulate the behaviors of different users²from novice to expert users.

Browser emulation: Enables the tester to specify which browser the virtual user emulates. Emulate cache: Emulates a user browsing with a specific cache size. as well as any custom browser. LoadRunner supports Netscape and Internet Explorer. Caching can be turned off based on server requirements. IP spoofing: Tests the performance impact of IP-dependent components by assigning virtual users their own IP addresses from the   .

LoadRunner can enable the Continue on Error feature when the virtual user encounters an error during replay. instructing how long to wait between intervals. ‡ Error handling: Regulates how a virtual user handles errors during script execution. Extended logging also tracks warnings and other messages.‡Iterations: Commands repetition of virtual user scripts. Step 3: Defining User BehaviorRuntime Settings . rendezvous and output messages. Standard logging maps all transactions. Iterative testing defines the amount of work a user does based on the number of times a process is performed using varying data. Also paces virtual users. ‡ Log files: Stores information about virtual user server communication.

it provides complete visibility of the tests and Virtual users. As a single point of control. .Step 4: Creating a Load Test Scenario ‡ LoadRunner·s controller is used to create a scenarios.

Step 4: Creating a Load Test Scenario ‡ Define total number of Virtual users needed to run the scripts ‡ Scheduler: LoadRunner Scheduler is used to ramp virtual user numbers up/down in order to position virtual users in both the ready state and the running state. . This method is useful for avoiding unnecessary strain on the system. ‡ Load can be Generated on the same machine where LoadRunner Controller is running or it can be generated on separate machine. ‡ Load Generator machine can reside inside Firewall or outside Firewall.

Controller & Generator both outside Firewall HTTP request HTTP Response X = Network Time y Response Time= X + Y Drawbacks: Bandwidth Limitation Unpredictable and Random results .

Controller Outside Firewall Off shore Network VPN / Direct Connectivity MI_Listner Load Generator Onsite Network Load Runner Agent Monitor Over Firewall Controller Console Advantages: ‡Network delay absent ‡Realistic and Predictable results ‡More accuracy .

. network devices and the most common Web servers. ‡ The performance monitoring is done in a completely non-intrusive manner to minimize performance impact. application servers and database servers.Step 5: Running Load Test Scenarios and Monitoring the Performance ‡ LoadRunner provides performance monitors for the network.

Step 5: Running Load Test Scenarios and Monitoring the Performance .

SilverStream. Throughput System Resource Graphs: Server resource  eb Application Server Graphs: Broad Vision.Step 5: Running Load Test Scenarios and Monitoring the Performancenumber of environments to provide for more ‡ LoadRunner supports a accurate online monitoring. WebLogic Database Server Resource Graphs: SQL Server. including Runtime Graphs: Virtual User Status. Oracle . MS Active Server Pages. User Defined Data Points Transaction Graphs: Response Time. Transactions (pass/fail)  eb Server Resource Graphs: Hits per Second. Cold Fusion.

high-level drill-down capabilities that enable testers to locate bottlenecks in these scenarios. ‡ LoadRunner provides a variety of performance graphs .Step 6: Analyzing the Results ‡ Evaluating results is the most important step in the load testing process ‡ LoadRunner·s Analysis component provides a single integration environment that collectively gathers all the data generated throughout the testing cycle. ‡ Testers can create cross-scenario comparisons of the graphs ‡ LoadRunner Analysis provides advanced.

Some Other Useful Tips     Recording and modifying the script take up a major amount of time in the entire Load testing cycle It is advisable to concentrate on one script at a time One may also perform a very limited test means just a large numbers of users merely log on and log out of the application. If application is inherently week it will break at this stage itself The client would ideally like All the business process in his application to be .

Applications should be functionally stable before they are presented for Load Tested    . Typically. This testing is not an alternative for ¶Functional Testing·.Important Aspect of Load Testing Load testing is primarily to be used only to judge the load bearing capacities of an application.

‡ Identify performance problems . ‡ Measure a single step or a group of steps.Why Add LoadRunner Transactions? ‡ Measure High Risk business process.

‡ Checkpoints ² Good practice. preferences tab before running the recorded Vuser script.  Make sure that Enable Image and Text Check is checked in the Run-time settings. .Checkpoints ‡ hy use Checkpoints?  Verify the correct functionality under load.  Add text and Image checks during recording.  Give a checkpoint a name that describes what is being verified.  A transaction may report a pass even though the business process failed.

‡ We can parameterize input data and Checkpoints. .Parameterization ‡ Parameterization allows to substitute many values for one recorded value.

‡ Data Caching  Response time are inaccurate  Real user activity not emulated  Servers are not exercised ‡ Test Applications with many set of Data ‡ Date constraints make recorded date invalid .Objective of Parameterization ‡ Unique Constraints make prevent reusing recorded data.

Parameter Types ‡ Date/Time: Current Date and/or time ‡ File: Data from text file ‡ Random Numbers: From user defined range of Numbers .

Data Access Method in File ‡ Sequential Access Method ‡ Random Access Method ‡ Unique Method .

Sign up to vote on this title
UsefulNot useful