Load Runner Tutorial
Applications are tested using LoadRunner to gauge system performance and behavior under stress. We will explain how to test scalable web applications in this LoadRunner tutorial.
Introduction to Load Runner
A software testing tool made by OpenText is called LoadRunner. To measure system performance and behavior under load, it is used to test applications. In this Load Runner tutorial, we cover the following briefly:
- Overview of Load Runner
- Steps Involved in Performance Test Using Load Runner
- Protocols in Load Runner
- Single vs. Multiple Protocol
- Popular Terminologies of Load Runner
- Advantages of Load Runner
Overview of Load Runner
The idea behind LoadRunner is to record and repeat user actions to create the appropriate load on the server. Creating a virtual load merely mimics the actions of a real user and aids in determining how well a software program or system performs. Get started on your learning journey with our software testing courses in Chennai.
The primary actions consist of:
- Recording/Scripting: Using a script to record user action.
- Test Execution: To replicate a real-world scenario in the test environment, repeat the script in tandem with the virtual load.
- Result Analysis: To give precise findings regarding the application’s responsiveness and ability to handle loads.
LoadRunner creates virtual users to execute scripts that mimic actual user activity.
- “Vusers” is the term for these virtual users.
- The traffic on the server is produced by Vusers running concurrently throughout the execution of performance tests.
- After the test is over, LoadRunner gathers the data and stores it in a file called raw results.
- The Microfocus Analysis tool can be used to open this file and undertake additional analysis of the test result.
- The analysis tool ultimately produces a report that summarizes the test outcome.
Components of Load Runner
Major components of LoadRunner include the following:
- Virtual User Generator or VuGen: It is a tool that captures business processes used by end users and builds an automated test script that looks like a programming language. The created script is referred to as a “Test Script” or “VuGen Script.”
- Load Generators: These are devices that create virtual loads following specifications. Every user in the scenario is assigned to a load generator by the Controller during test execution. To replicate the users’ geographic location, a load generator is also employed.
- Controller: It plans, directs, oversees, and keeps an eye on the load test. Workload modeling also makes use of a controller. The process of creating a test scenario by NFR (non-functional requirement) is known as workload modeling.
- Agent: The LoadRunner agent establishes contact between the load generator and the controller.
- Analysis: To check the test result against the specified NFRs (non-functional requirements) and identify the bottleneck (performance problems), the analysis tool shows graphs and statistics of the test results. Based on the test result, the analysis tool also produces a report.
Our manual testing training makes you understand everything about the manual testing process.
Steps Involved in Performance Test Using Load Runner
LoadRunner goes through five main processes. Almost all of the performance testing products on the market adhere to the same procedures as LoadRunner.
- Script Creation
- Scenario Creation
- Test Execution and Monitoring
- Result Gathering and Analysis
- Reporting
Script Creation
To capture the business flows, LoadRunner features a special component called “VuGen,” or “Virtual User Generator.” The actual user’s website navigation is captured by VuGen, which then translates it into a script.
The ANSI C scripting language is supported by VuGen and is simple to learn and comprehend. The C programming language makes it simple to define variables and functions, write custom code, and apply new logic, which makes scripting in LoadRunner simple.
Three main steps go into creating a LoadRunner script:
- Protocol Identification: You must be aware of the application’s technology and platform to write a script.
- Script Recording: LoadRunner’s greatest benefit is its recording feature. It eliminates the need for a performance tester to spend time and energy writing manual code and supports recording for 90%–95% of protocols.
- Script Enhancement: LoadRunner creates a simple script of sophisticated correlation, parametrization, etc. Upon recording completion, script enhancement fully automates the VuGen script. The steps in script enhancement are as follows:
- Parameterization
- Correlation
- Insert Transactions
- Add Rendezvous Points
- Insert Basic Function
- Insert Comments
- Enable log messages
- Insert synchronization points
- Set up the run-time setting.
Scenario Creation
A scenario outlines the test’s objectives and methodology. A load runner scenario includes the test time, a list of machines, a defined workload model, and the script.
- Performance testing is necessary under NFR (non-functional requirements) for the set of business flows as they relate to the LoadRunner script.
- The Performance Center’s “Test Plan” or the load runner’s “Controller” generates a scenario. The configuration and scheduling of the scenario, which dictates the behavior of all load generators and Vusers during the test, are set during scenario design.
- Proper NFRs, the anticipated TPS (transaction per second), and user count are necessary before creating a scenario.
The scenario must be created in a way that allows for the achievement of the desired metrics (TPS and user load). To get the desired results, you may occasionally need to adjust the script’s thought time and pacing. Consult the following calculators to assist you in generating the appropriate scenario:
- Pacing
- Think Time
- No. of Users
- TPS
- No. of required LGs
Test Execution and Monitoring
To begin monitoring the graphs, you just need to “run” the scenario that has been constructed.
- You can be sure that the performance test is running as planned and that every Vuser is adhering to the same business processes that were addressed in the scripts.
- The transactions of the Vuser script are measured, recorded, and shown on the dashboard by LoadRunner during the test execution process.
- There are numerous monitoring graphs available in LoadRunner that display client-side data.
- There are several of them, including response time, TPS, running Vuser, throughput, system performance, etc.
- Monitoring server-side statistics is another advantage that comes with integrating some external monitors, such as SiteScope.
Result Gathering and Analysis
Following the test, the controller compiles and aggregates the results. The raw format contains the compiled result.
- The test result can also be obtained in HTML format if you operate in the Performance Center and select the “Collate and Analysis” option.
- These files with the test results can be downloaded to your local computer.
- The “Analysis” tool, a feature exclusive to LoadRunner, is used to analyze the outcome.
- The analysis tool offers the ability to view the raw result file, which is produced following the test and shown in a tabular and graphical format.
- The analysis tool is equipped with numerous features that provide an in-depth examination of the obtained data and identify the real bottlenecks.
- To finish diagnosing the problems, you can also add filters, correlation, merging, and overlay options to the graphs.
Reporting
An analysis tool offers multiple report formats. After the test analysis is finished, you can create a summary of the test results, identify the bottleneck and describe it, select the graphs you want to be included in the report, and generate it in the format you want (.doc,.docx,.pdf,.html, etc.).
To let the client or project know who was involved in the testing, report generation also includes an option to add the organization’s logo, the name of the author, the name of the tester, etc.
Key points to choose the LoadRunner protocol for scripting
- Application type: You must understand the kind of application, standalone, web, mobile, or Internet of Things. After gaining access to the application and running it manually, you may quickly comprehend the type.
- Architecture: The application architecture or development team can provide you with the specifics of the architecture. They can tell you if the application is multi-tiered, tier-1, tier-2, or tier-3 architecture. The majority of programs accept the Web HTTP/HTML protocol and feature tier-3 or multi-tier design.
- Network/Application Level Protocol: You must find out if an application uses any higher-level protocols or sends requests across TCP/IP.
- Platform: This describes the application’s build platform, such as Java, .net, Flex, Web Services, etc.
If your interest is testing the application developed by Java programming, check out our JMeter training in Chennai with hands-on exposure.
Protocols in Load Runner
LoadRunner establishes communication between Vuser and Server based on topology, application type, and technology. For the server to respond to the Vuser appropriately and accurately, it must comprehend the request that the Vuser sent.
As a result, LoadRunner takes advantage of the protocol to provide clear and easy communication. Some of them are as follows:
- .Net: allows Microsoft.NET client-server technologies to be recorded.
- C Vuser: A standard C library is used by this generic virtual user.
- Citrix ICA: A tool for remote access that lets users launch particular programs on other computers.
- CoAP (Constrained Application Protocol): To ascertain scalability and dependability under high usage, the CoAP protocol for LoadRunner enables performance testing against front-end CoAP proxies with the specified methods/verbs.
- Flex: Rich Internet Applications (RIAs) can be developed using Flex, an application development technology, both online and in the workplace.
- Java Vuser: Java programming language with support at the protocol level.
- Web-HTTP/HTML: makes it possible to record native mobile applications.
- MQTT: It enables lightweight publish/subscribe messaging that is perfect for mobile applications where battery life and bandwidth are limited, as well as Internet of Things (IoT) and machine-to-machine (M2M) communications.
- ODBC or Open Database Connectivity: It is a protocol that offers a standard interface for database access.
- Oracle NCA: Java client, web server, and database comprise the Oracle 3-tier architecture database.
- Web Services: Web Services are a programmatic interface that allows programs to talk to each other across the Internet.
For a web application: you can choose the Web HTTP/HTML protocol from the list and attempt to capture the flow if you only have a portion of the information above. If you experience problems with recording, look up the relevant fix in the LoadRunner community. The multi-protocol option is another way to control the recording.
Regarding web services: You can load and write the script directly if you have the XML or web service URL. Explicit recording is not required for web services.
For IoT and mobile applications: LoadRunner includes specific protocols and is capable of recording IoT and mobile applications. These protocols can be easily used to record and write a script.
Upgrade your skills with automation testing through our Selenium training in Chennai.
Single Protocol vs. Multiple Protocol
When you launch VuGen and click “File” in the main menu bar, choose “New Script and Solution.” A pop-up window displaying the list of all the protocols then appears while you are generating the script.
The following options are visible under the “Category” section:
- Single Protocol
- Multiple Protocol
- Mobile and IoT
- Popular
- Recent
Single Protocol Category: A list of all the protocols that LoadRunner supports is displayed in the Single Protocol category. All you have to do is pick one and begin the scripting.
Multiple Protocol Category: Only a few protocols are displayed in the Multiple Protocol category. The other non-supportive protocols are disabled when you choose the one.
For example, the Web – HTTP/HTML protocol will not be enabled if you choose the Flex protocol. You can choose more than one protocol for an application and carry on with the scripting by using Multiple Protocol.
Popular Terminologies of Load Runner
It can be a little challenging to learn LoadRunner without a fundamental comprehension of the phrase. Let’s begin by learning the fundamentals:
- SLA: A mutual agreement on performance metrics between the client and tester is called a service level agreement, or SLA.
- Example: For one hour, application X needs to accommodate 100 users loading at 2 TPS.
- Performance Metrics: These are the metrics used to measure statistics related to clients, servers, and networks.
- Examples include throughput, response time, and transactions per second.
- Transaction: A transaction is a collection of end-user actions on an application that corresponds to actual user activity.
- Example: Click on the link, click the submit button, log out, and so on.
- Business Process: A series of actions that illustrate a use case or a business function is called a business process. One or more transactions are included.
- Example: Product Order, Search Item, etc.
- Scenario: A group of business procedures assembled according to performance standards. A scenario is a window in which business processes can be defined together with the number of users, test duration, Vuser running style, etc. Another name for scenario building is workload modeling.
- Vusers, also known as virtual users, simulate users in the actual world. It is equivalent to the server’s anticipated load.
- Protocol: The way a client and server communicate with each other. The protocol chosen for an application is determined by its language and technology.
- Examples are Ajax TruClient and Web HTTP/HTML.
- Load Generator: The devices that create virtual users are called load generators.
- Controller: It plans, directs, oversees, and keeps an eye on the performance exam. During the test, the controller uses the agent to communicate with the load generators.
- Iteration: repeating the Vuser script’s defined transaction flow.
- Pacing: Time lapsed between two cycles
- Think Time: The interval between two purchases
- vuser_init(): User-defined functions, user-defined variables, login, and other initialization components are contained in the script’s vuser_init() section. During the test, it only executes once.
- Action(): The business process is contained in this part and is carried out iteratively. Real-user activities that can be divided up by transactions are included in the action section. Depending on how the script logic is developed, it might or might not involve a login and logout transaction.
- vuser_end(): The script’s exit phase. Like vuser_init(), it only executes once. There could be an application logoff phase.
- Run Logic: Except vuser_init and vuser_end, Run Logic specifies how many times each activity will be carried out.
- Correlation: This technique deals with the dynamic values that the server generates. There are manual and automatic correlation options in LoadRunner.
- LoadRunner searches the recorded script for the dynamic value in autocorrelation. If LoadRunner is unable to determine the dynamic value, we must manually determine it by utilizing replay and recording logs.
- Parameterization: During the performance test, parameterization is used to insert various values into the stated variables.
- Five Vusers in a scenario are identified by the UserIDs AA, BB, CC, DD, and EE. A defined parameter called _userID is used to pass these values, and it will pass each value to a specific user.
- Rendezvous points: The locations where users wait for one another to show up before concurrently hitting the next transaction. It is employed to produce all traffic for any given feature.
Gain expertise in web development with our web design and development courses.
Advantages of Load Runner
The following are the advantages of Load Runner:
- Simple and interactive user interface.
- User-friendly components.
- Virtual users to reduce manual testing
- Real-world loads on the server.
- Limits the requirement for excess hardware.
- Single point of control over all the Vusers.
- Intelligent auto-correlation feature
- Supports mobile and cloud performance testing
- User load test of any pattern.
- Live graphs and statistics of client-side performance.
- Supports monitoring the network and server resources
- Option to generate the reports in multiple formats.
- 100% automation of the test cases
- On-premise and cloud options are available.
- Dedicated Team Support
Conclusion
We hope this load runner tutorial will help you grasp the fundamental understanding of software and web testing with load runner. Accelerate your career in software automation testing with our load runner training in Chennai.