Automated Testing - Load Runner | Mana Blog... for all
Jan 12, 2011

LoadRunner is a performance and load testing product by Hewlett-Packard (since it acquired Mercury Interactive in November 2006) for examining system performance, while generating actual load. LoadRunner can emulate hundreds or thousands of concurrent users to put the application through the rigors of real-life user loads, while collecting information from key infrastructure components (Web server, database servers etc). The results can then be analysed in detail, to explore the reasons for particular behaviour.

Consider the client-side application for an automated teller machine (ATM). Although each client is connected to a server, in total there may be hundreds of ATMs open to the public. There may be some peak times — such as 10 a.m. Monday, the start of the work week — during which the load is much higher than normal. In order to test such situations, it is not practical to have a testbed of hundreds of ATMs. So, given an ATM simulator and a computer system with LoadRunner, one can simulate a large number of users accessing the server simultaneously. Once activities have been defined, they are repeatable. After debugging a problem in the application, managers can check whether the problem persists by reproducing the same situation, with the same type of user interaction.

Working in LoadRunner involves using three different tools which are part of LoadRunner. They are Virtual User Generator (VuGen), Controller and Analysis.

The Virtual User Generator (VuGen) allows a user to record and/or script the test to be performed against the application under test, and enables the performance tester to play back and make modifications to the script as needed. Such modifications may include Parameterization (selecting data for keyword-driven testing), Correlation and Error handling.

LoadRunner supports several protocols like Web HTTP/HTTPS, Remote Terminal Emulator, Oracle and Web Services. A protocol can be understood as a communication medium between the clients and the server. For example an AS400 or Mainframe based application use Terminal Emulator to talk to the Server where as a Web Online banking application uses HTTP/HTTPS with some Java and Web services. LoadRunner is capable of recording scripts in both single and multi-protocol modes.

During recording, VuGen records a tester's actions by routing data through a proxy. The type of proxy depends upon the protocol being used, and affects the form of the resulting script. For some protocols, various recording modes can be selected to further refine the form of the resulting script. For instance, there are two types of recording modes used in LoadRunner Web/HTTP testing: URL based, and HTML based.

LoadRunner allows any portion of a string to be replaced by a parameter. Parameters may be defined in a CSV or dat file; or they may be defined dynamically in a LoadRunner script.

Common situations where parameterization is used include:
  1. When the application needs unique data (such as user name)
  2. Data dependency (such as passwords)
  3. Data cache
  4. Date constraints
Correlation is a method used by LoadRunner to handle dynamic content. Dynamic content refers to page components that are dynamically created during every execution of the business process and always differ from the value generated in previous runs. Examples of dynamic content include the ticket number in an online reservation system or a transaction id in an online banking application. These dynamic contents are a part of the server response. The LoadRunner usually identifies these on the basis of the left and right boundaries and ordinal identifiers. Correlation automatically inserts LoadRunner commands to parameterize the dynamic contents it identifies in the server response.

Once a script is prepared in VuGen, it is run via the Controller. LoadRunner provides for the usage of various machines to act as Load Generators. For example, to run a test of 1000 users, we can use three or more machines with a LoadRunner agent installed on them. These machines are known as Load Generators because the actual load will be generated from them. Each run is configured with a scenario, which describes which scripts will run, when they will run, how many virtual users will run, and which Load Generators will be used for each script. The tester connects each script in the scenario to the name of a machine which is going to act as a Load Generator, and sets the number of virtual users to be run from that Load Generator.

LoadRunner uses monitors during a load test to monitor the performance of individual components under load. Some monitors include Oracle monitors, WebSphere monitors, etc... Once a scenario is set and the run is completed, the result of the scenario can be viewed via the Analysis tool.

0 comments: