LoadRunner is a licensed tool provided by Micro Focus and is one of the most effective performance testing tools available in the market. Along with supporting a wide range of protocols, it also provides a wide range of platforms, tools, databases and environments for testing software applications. Due to its impact in the performance testing domain, especially its usage in the load testing of software applications, LoadRunner has become popular among the developer community in business enterprises.
In this article, we will see what are the most commonly asked LoadRunner interview questions for both freshers and experienced individuals. Please note that, since this is a testing tool, it is advised to have hands-on experience of the LoadRunner Software in order to really ace the interview.
Load testing is the process of examining how a system behaves under normal and significantly high loads by simulating real-world loads on the application. This testing helps us understand how well our application can cope with the peak loads simultaneously on the servers during the maximum demand scenarios. Without load testing, there are chances that we might have underestimated how well the application would perform and when the application is under heavy user loads, the application might crash which could potentially result in huge losses to the business. Load testing is typically done when the development of the software/application is close to completion.
LoadRunner is a licensed performance testing tool provided by Micro Focus. Earlier it was called HP LoadRunner. It is essentially used for testing the behavior and the performance of an application under various load conditions. The following are the advantages of LoadRunner:
Performance testing is the process of evaluating an application's performance under varying load and stress conditions. Performance is commonly measured by the time it takes for an application to respond to user actions. LoadRunner supports the following types of performance testing:
The following are the major components of LoadRunner:
Following are the steps to run a test on LoadRunner:
Following are the steps involved in the creation of Vuser Script:
New Script and Solution
or New Solution
button.Create a New Script
. Here select the protocols that you want to test with from the Category
list and enter the name for your script in the Script Name
field. (It is advised not to name the scripts init
, run
or end
as these are the keywords that are being used internally by the VuGen.)Create
to create the blank Vuser script.For a more detailed overview of the steps involved in the scripting process, you can refer [here].(https://admhelp.microfocus.com/vugen/en/2022-2022-r2/help/WebHelp/Content/VuGen/c_creating_Vuser_scripts_overview.htm)
vuser-init
, action
and vuser-end
sections?vuser-init
: This records the initialization operations called as pre-operations before the application is actually executed.
action
: This is used for recording the business processes.
vuser-end
: This is used for recording log-off activity to the server.
In LoadRunner, Vuser is a replacement to human users and is used for imitating behavior of real users by executing specified business activities mentioned in the Vuser script of the application under test. These activities are recorded in the recording session. Vuser script is a script generated with the help of the VuGen component that controls the activities of Vusers for accomplishing a specific goal. Every Vuser executes the Vuser script. The performance of the application under test is tracked by functions defined in the Vuser script.
Logs are files that are crucial for debugging a script. Logging is mainly used for debugging and is disabled during script execution. However, we can enable logs for errors only after the script has been launched. LoadRunner supports two types of Vuser logs, they are:
Standard logs create logs of messages and functions sent to the server during the execution of the script whereas extended logs are used for logging additional warnings and other messages required for debugging process.
Ramp up: This refers to increasing (ramping up) load gradually on a server. For example, we can gradually increase the number of Vusers that creates load on the server under test. The initial value for ramp-up would be set by default and we can specify what is the value to wait between intervals. This can be configured by just going to 'Scenario Scheduling Options' in LoadRunner.
Ramp down: This refers to decreasing the load (ramping down) gradually on a server. Gradually decreasing the number of Vusers is an example of a ramp-down. Ramp-down can be correlated to the scenario when an application in real-time sees a drop in concurrent users after the peak time.
Following are the benefits of ramp up and ramp down:
Correlation deals with managing dynamic values in a test script. The values could change depending on every user action dynamically. Correlation ensures that the dynamic values do not break down during the execution of the script. There are two types of correlation:
A scenario is a description of events that is supposed to take place during testing. It regulates and specifies the number of users that need to be emulated, the sequence of actions which has to be performed and the machines on which virtual users should execute the actions and simulations.
To create a scenario:
To run a scenario:
LoadRunner has two types of scenarios:
Elapsed time indicates how much time has elapsed (or passed) since the start of current event. For scenario status window, the elapsed time is measured from the exact moment "Start Scenario" or "Initialize/Run Vuser" button is clicked. For Vuser window, elapsed time is calculated from the moment Vuser enters the "running" state.
Checkpoints are the verification points that help to identify if your script has tested the flow properly. Sometimes, the script may not have tested the flow properly, but still, returned the test as PASS. To ensure that proper workflow has been followed, we use checkpoints. LoadRunner supports two types of checkpoints:
We can enable the text and image checks in VuGen by making use of the web_find and web_image_check functions respectively. We can also enable this by enabling text and image checks from runtime settings as –> Go to Runtime Settings -> Click on "Preference" -> Enable Image and Text checkbox
The lr_abort() function does the task of aborting the execution of the script after the execution of the "vuser_end" section. It is useful when we require to abort the script manually due to a specific error criteria.
The lr_exit() function lets the user exit from script at the time of execution by giving different continuation options like exiting the Vuser or exiting current iteration and continuing with next. There are three ways from which script execution can be exited by the LoadRunner. It can be the exit from iteration, action or the script itself. The syntax of lr_exit is:
Here, the continuation_option specifies how script should continue after calling lr_exit and the exit_status (LR_PASS, LR_FAIL, LR_AUTO or LR_STOP) defines what should be the status of exit of the scenario group.
The following are types of continuation options available:
It is interesting to note that if lr_exit is called with LR_EXIT_VUSER as continuation option and LR_ABORT as exit status, then it equals the lr_abort functionality as both of its aim is to abort the script execution.
The count of Vusers depends on the application under test, hardware settings, infrastructure like network configurations, memory, operating system and objective of the performance test. We cannot provide a generic value for the number of Vusers.
Earlier, performance testers had to rely mostly on the project development team to understand what protocol the system under test uses to interact with the server. But, from version 9.5 onwards of LoadRunner, we have a protocol advisor that inherently detects what protocol the application uses and suggests the testers about the best protocol using which the script can be created for simulating real user testing.
Rendezvous points create intense load (as defined by rendezvous policy) on the server by instructing multiple Vusers to perform certain tasks simultaneously. They also enable the LoadRunner Professional to calculate the performance under this load. For example, if we want to test how a banking system website performs when there are 20 Vusers simultaneously checking for their account information, we emulate this by instructing the Vusers to check their account information at the same time by creating a rendezvous point. When a Vuser arrives at the rendezvous point early, the LoadRunner Controller holds it there as per the rendezvous policy. A rendezvous policy can be configured based on which the Controller can release the Vusers from that rendezvous point when required Vusers arrive or after a specific amount of time has elapsed. The Vusers are released to perform multitasking simultaneously to simulate the load. A rendezvous point is simply a meeting point for the Vusers between transactions.
Rendezvous points can be inserted in any one of the below ways:
After insertion of the rendezvous point, VuGen inserts lr_rendezvous("name_of_point")
function into Vuser script to mark that point in the script as a rendezvous point.
The Performance Testing Life Cycle is a systematic process of carrying out non-functional testing of software applications under test. Performance testing helps to identify bottlenecks in performance and gives an overview of how well our system can perform under varying conditions. The lifecycle of performance testing consists of the following steps:
When we run Vuser as a process, same driver program will be loaded into memory for each Vuser. This results in high RAM consumption and restricts how many Vusers we want to execute in that single generator. However, if we run Vuser as a thread, then only one instance of the driver program will be loaded into memory for that many Vusers. This type of multithreading mode allows us to add and run more Vusers on a single generator. Hence, running on thread is more advantageous.
There are two possible ways to identify if a project requires correlation or not:
It is not possible to perform manual correlation when script runs. However, the script can be stopped and then we can make the required changes.
The autocorrelation rules can be exported to a .cor file and it can be then shared with the teammates. The teammate then has to import this file into autocorrelation rules present in their workstation.
Following are some of the changes we can make in the run-time settings:
Monitors are used for monitoring the performance bottlenecks by helping to identify problematic area that leads to an increase in response times. Monitors are available in LoadRunner controllers. Some monitors would be enabled by default and their statistics would be visible while running the test. However, most monitors require configuration within the Controller component. LoadRunner Controller provides monitors like Run-time, Transaction, Web Resource, Network, System Resource, Firewall, Database Server Resource, Web Application Server, Dynatrace, Kafka and many more!
To set up the monitoring environment in LoadRunner Professional, we need to follow the below steps:
Graphs
section for displaying in right pane of Run tab.Add Measurements
on the graph or from the graph menu (in hamburger shape). This opens the Monitor dialog box. Here, Go to the Monitored Server Machines
section and click Add
. This opens the Add Machine
dialog.Monitored Server Machines
section of the Monitor
dialog.Resource Measurements
part in the Monitor dialog, click Add
and define the server measurements in the Monitor Configuration
dialog.Think time refers to the delay that happens between the time when user receives the response from a server and the time taken by user to review this response. This can be emulated in LoadRunner by intentionally configuring wait time between the script actions. The threshold level of think time refers to the level below which the think time recorded is ignored. The default threshold level value for this field is 5 seconds. This value can be changed in VuGen by going to the Recording Options
. Go to Recording Options
, then go to Script
, and then you can generate think time greater than the threshold.
VuGen stands for Virtual User Generator. This is usually where the actual scripting takes place. Running a script in VuGen is beneficial if we want to debug while we are writing it as the VuGen lets us see where the script has failed, what the response of the script is and what needs to be changed. However, this is useful only to test with a single user and is limited to local machine only. When we are ready with the script after debugging here, we can run the script in controller. The controller is like a command centre in LoadRunner because here we have options to ramp up the number of Vusers, select scenario configuration based on the workload model, configure monitors etc. In addition to this, the controller does not launch separate VuGen instance for each Vuser while running the script.
Hits Per Second is a measure of the number of times our site is hit/visited by users in any second. It corresponds to the number of times users send HTTP requests to web server.
Throughput is a measure of number of requests a software can handle per hour, or per minute or per second. An increase in the Response time of requests decreases the throughput.
Concurrent users define the number of users for given test duration whereas simultaneous users define the number of users performing same transactions at a particular point of time. All concurrent users are not same as simultaneous users, however, all simultaneous users are actually concurrent users.
In LoadRunner, when a script is running, all Vusers working on the test are concurrent users as they are assigned to use the application under test at same time. However, the Vusers might not be performing same activity at any instant of time. For example, in the image below, we can see that there are 6 Vusers available and performing a series of actions in an application under test. We can observe that not all Vusers would be in same step at that point for concurrent users. Whereas for simultaneous users, we can see that all users would be performing same activities at that instant of time.
It is possible to convert concurrent users to simultaneous users by making use of rendezvous points. When we add rendezvous points in between actions, the controller waits for specified number of Vusers to arrive at that point so that they can perform tasks at the same time.
Yes, caching has a lot of impact on load testing. In the presence of caching, the surf history would be stored in a temporary memory called cache and whenever information is required to load a page, it would be loaded mostly from cache thereby reducing the time taken to load the page for second and subsequent times. This will affect the reaction times in the testing results as they would not be accurate while testing varying loads. Hence, caching should be disabled before we perform load testing.
Since we have "Passed" and "Failed" labels in the page, we can make use of the text check using the web_reg_find
method and SaveCount
to store the number of matches found in the webpage as follows:
LoadRunner has become an important software performance testing tool in the corporate world as it provides various powerful tools to emulate the real-world scenarios effectively under varying load. Hence, it is important to have both practical experience and theoretical knowledge about this tool for any software testers as well as software developers. In this article, we have seen the most commonly asked interview questions in LoadRunner for both freshers and experienced professionals in software testing and development fields.
LoadRunner Official Documentation:
Testing Interview References: