LOADRUNNER Interview Questions & Answers: What Is Load Testing?
LOADRUNNER Interview Questions & Answers: What Is Load Testing?
com/
Load testing is to test that if the application works fine with the loads that result from large
number of simultaneous users, transactions and to determine weather it can handle peak
usage periods.
Step 1: Planning the test. Here, we develop a clearly defined test plan to ensure the test
scenarios we develop will accomplish load-testing objectives. Step 2: Creating Vusers.
Here, we create Vuser scripts that contain tasks performed by each Vuser, tasks performed
by Vusers as a whole, and tasks measured as transactions. Step 3: Creating the
scenario. A scenario describes the events that occur during a testing session. It includes a
list of machines, scripts, and Vusers that run during the scenario. We create scenarios using
LoadRunner Controller. We can create manual scenarios as well as goal-oriented scenarios.
In manual scenarios, we define the number of Vusers, the load generator machines, and
percentage of Vusers to be assigned to each script. For web tests, we may create a goal-
oriented scenario where we define the goal that our test has to achieve. LoadRunner
automatically builds a scenario for us. Step 4: Running the scenario.
We emulate load on the server by instructing multiple Vusers to perform tasks
simultaneously. Before the testing, we set the scenario configuration and scheduling. We
can run the entire scenario, Vuser groups, or individual Vusers. Step 5: Monitoring the
scenario.
We monitor scenario execution using the LoadRunner online runtime, transaction, system
resource, Web resource, Web server resource, Web application server resource, database
server resource, network delay, streaming media resource, firewall server resource, ERP
server resource, and Java performance monitors. Step 6: Analyzing test results. During
scenario execution, LoadRunner records the performance of the application under different
loads. We use LoadRunner’s graphs and reports to analyze the application’s performance.
When do you do load and performance Testing?
We perform load testing once we are done with interface (GUI) testing. Modern system
architectures are large and complex. Whereas single user testing primarily on functionality
and user interface of a system component, application testing focuses on performance and
reliability of an entire system. For example, a typical application-testing scenario might
depict 1000 users logging in simultaneously to a system. This gives rise to issues such as
what is the response time of the system, does it crash, will it go with different software
applications and platforms, can it hold so many hundreds and thousands of users, etc. This
is when we set do load and performance testing.
The Virtual User Generator (VuGen) component is used to record a script. It enables you to
develop Vuser scripts for a variety of application types and communication protocols.
What Component of LoadRunner would you use to play Back the script in multi
user mode?
The Controller component is used to playback the script in multi-user mode. This is done
during a scenario run where a vuser script is executed by a number of vusers in a group.
What is a scenario?
A scenario defines the events that occur during each testing session. For example, a
scenario defines and controls the number of users to emulate, the actions to be performed,
and the machines on which the virtual users run their emulations.
Parameters are like script variables. They are used to vary input to the server and to
emulate real users. Different sets of data are sent to the server each time the script is run.
Better simulate the usage model for more accurate testing from the Controller; one script
can emulate many different users on the system.
What is correlation? Explain the difference between automatic correlation and
manual correlation?
Correlation is used to obtain data which are unique for each run of the script and which are
generated by nested queries. Correlation provides the value to avoid errors arising out of
duplicate values and also optimizing the code (to avoid nested queries). Automatic
correlation is where we set some rules for correlation. It can be application server specific.
Here values are replaced by data, which are created by these rules. In manual correlation,
the value we want to correlate is scanned and create correlation is used to correlate.
How do you find out where correlation is required? Give few examples from your
projects?
Two ways: First we can scan for correlations, and see the list of values which can be
correlated. From this we can pick a value to be correlated. Secondly, we can record two
scripts and compare them. We can look up the difference file to see for the values, which
needed to be correlated. In my project, there was a unique id developed for each
customer, it was nothing but Insurance Number, it was generated automatically and it was
sequential and this value was unique. I had to correlate this value, in order to avoid errors
while running my script. I did using scan for correlation.
When do you disable log in Virtual User Generator, When do you choose standard
and extended logs?
Once we debug our script and verify that it is functional, we can enable logging for errors
only. When we add a script to a scenario, logging is automatically disabled. Standard Log
Option: When you select
Standard log, it creates a standard log of functions and messages sent during script
execution to use for debugging. Disable this option for large load testing scenarios. When
you copy a script to a scenario, logging is automatically disabled Extended Log Option:
Select
extended log to create an extended log, including warnings and other messages. Disable
this option for large load testing scenarios. When you copy a script to a scenario, logging is
automatically disabled. We can specify which additional information should be added to the
extended log using the Extended log options.
How do you write user defined functions in LR? Give me few functions you wrote
in your previous project?
Before we create the User Defined functions we need to create the external
library (DLL) with the function. We add this library to VuGen bin directory. Once the library
is added then we assign user defined function as a parameter. The function should have the
following format: __declspec (dllexport) char* (char*, char*)Examples of user defined
functions are as follows:GetVersion, GetCurrentTime, GetPltform are some of the user
defined functions used in my earlier project.
- We set Iterations in the Run Time Settings of the VuGen. The navigation for this is Run
time settings, Pacing tab, set number of iterations.
The lr_abort function aborts the execution of a Vuser script. It instructs the Vuser to stop
executing the Actions section, execute the vuser_end section and end the execution. This
function is useful when you need to manually abort a script execution as a result of a
specific error condition. When you end a script using this function, the Vuser is assigned the
status "Stopped". For this to take effect, we have to first uncheck the “Continue on error”
option in Run-Time Settings.
If web server, database and Network are all fine where could be the problem?
The problem could be in the system itself or in the application server or in the code written
for the application.
- By running “Database” monitor and help of “Data Resource Graph” we can find database
related issues. E.g. You can specify the resource you want to measure on before running the
controller and than you can see database related issues
It overlay the content of two graphs that shares a common x-axis. Left Y-axis on the
merged graph show’s the current graph’s value & Right Y-axis show the value of Y-axis of
the graph that was merged. Correlate Graph: Plot the Y-axis of two graphs against each
other. The active graph’s Y-axis becomes X-axis of merged graph. Y-axis of the graph that
was merged becomes merged graph’s Y-axis.
How did you plan the Load? What are the Criteria?
Load test is planned to decide the number of users, what kind of machines we are going to
use and from where they are run. It is based on 2 important documents, Task Distribution
Diagram and Transaction profile. Task Distribution Diagram gives us the information on
number of users for a particular transaction and the time of the load. The peak usage and
off-usage are decided from this Diagram. Transaction profile gives us the information about
the transactions name and their priority levels with regard to the scenario we are deciding.
In Running Vuser graph correlated with the response time graph you can see that as the
number of Vusers increases, the average response time of the check itinerary transaction
very gradually increases. In other words, the average response time steadily increases as
the load
increases. At 56 Vusers, there is a sudden, sharp increase in the average response
time. We say that the test broke the server. That is the mean time before failure
(MTBF). The response time clearly began to degrade when there were more than 56 Vusers
running simultaneously.
Correlation is used to obtain data which are unique for each run of the script and which are
generated by nested queries. Correlation provides the value to avoid errors arising out of
duplicate values and also optimizing the code (to avoid nested queries). Automatic
correlation is where we set some rules for correlation. It can be application server specific.
Here values are replaced by data, which are created by these rules. In manual correlation,
the value we want to correlate is scanned and create correlation is used to correlate.
An Introduction to LoadRunner
LoadRunner is a Performance test tool, it can be used for Load testing, Stress testing and
Endurance testing.
LoadRunner is available for Windows and UNIX versions (LoadRunner for Windows and
LoadRunner for UNIX)
LoadRunner is a protocol based test tool, where as QTP is a object based test tool. We can select
single or multiple protocols.
LoadRunner is a leading tool in performance testing sector, there it has more than 60% market
share.
Other competitor tools for Performance testing are IBM-RPT (Rational Performance Tester),
Borland-Silk Performer, QAWebload, Jmeter etc…
External Components:
2) Controller
3) Analysis
Internal Components:
For generating tests Recording is the only method in LoadRunner, LoadRunner uses C like
Vuser script, which we can edit.
We can insert Transaction points (Start and end) and Rendovez point in LoadRunner.
2) Controller: It is a hub of LoadRunner, here we can generate scenarios and run scenarios.
In Controller we can create VUsers, add Load generators and schedule our tests. In LoardRunner
several schedules available, we can choose our desired schedule.
Schedules are:
General schedule:
Ramp-up:
In this schedule we start some number of vusers for a specified time (Example 100 users for
every 10 seconds) and we stop all vusers at a time.
Ramp-down:
In this schedule we start all vusers at a time and we stop vusers step by step (Example 100 users
for every 10 seconds)
Start some number of vusers for a specified time (Example 100 users for every 10 seconds)
Stop some number of vusers for a specified time (Example 100 users for every 10 seconds)
Endurance Testing:
Example: 10000 vusers load continuously for 6 hours, in this approach; we can test reliability of
our Software Application
3) Analysis:
This component is used for Result viewing for analyzing results and for Result reporting.
LoadRunner is providing Result reporting in several formats like Document, HTML and Crystal
Reports.
Using LoadRunner, you divide your client/server performance testing requirements into
scenarios. A scenario defines the events that occur during each testing session. Thus, for example, a
scenario defines and controls the number of users to emulate, the actions that they perform, and the
machines on which they run their emulations.
In the scenario, LoadRunner replaces human users with virtual users or Vusers. When you run a
scenario, Vusers emulate the actions of human users —submitting input to the server. While a
workstation accommodates only a single human user, many Vusers can run concurrently on a single
workstation. In fact, a scenario can contain tens, hundreds, or even thousands of Vusers.
To emulate conditions of heavy user load, you create a large number of Vusers that perform a
series of tasks. For example, you can observe how a server behaves when one hundred Vusers
simultaneously withdraw cash from the bank ATMs. To accomplish this, you create 100 Vusers, and each
Vuser:
The actions that a Vuser performs during the scenario are described in a Vuser script. When you run a
scenario, each Vuser executes a Vuser script. The Vuser scripts include functions that measure and record
the performance of the server during the scenario. To measure the performance of the server, you define
transactions.
Transactions measure the time that it takes for the server to respond to tasks submitted by Vusers.
For instance, you can define a transaction that measures the time it takes for the server to process a
request to view the balance of an account and for the information to be displayed at the ATM. You insert
rendezvous points into Vuser scripts to emulate heavy user load on the server.
Rendezvous points instruct multiple Vusers to perform tasks at exactly the same time. For
example, to emulate peak load on the bank server, you insert a rendezvous point to instruct 100 Vusers to
simultaneously deposit cash into their accounts. You use the LoadRunner Controller to manage and
maintain your scenarios.
Using the Controller, you control all the Vusers in a scenario from a single workstation. When
you execute a scenario, the LoadRunner Controller distributes each Vuser in the scenario to a host. The
host is the machine that executes the Vuser script, enabling the Vuser to emulate the actions of a human
user. Vuser scripts include functions that measure and record system performance during load-testing
sessions. During a scenario run, you can monitor the network and server resources. Following a scenario
run, you can view performance analysis data in reports and graphs.
You can easily create and run load-testing scenarios by following the LoadRunner testing process
below. The following illustration outlines the testing process:
Successful load testing requires that you develop a thorough test plan. A clearly defined test plan
will ensure that the LoadRunner scenarios that you develop will accomplish your load testing objectives.
Using LoadRunner, you divide your client/server performance testing requirements into
scenarios. A scenario defines the events that occur during each testing session. Thus, for example, a
scenario defines and controls the number of users to emulate, the actions that they perform, and the
machines on which they run their emulations.
In the scenario, LoadRunner replaces human users with virtual users or Vusers. When you run a
scenario, Vusers emulate the actions of human users —submitting input to the server. While a
workstation accommodates only a single human user, many Vusers can run concurrently on a single
workstation. In fact, a scenario can contain tens, hundreds, or even thousands of Vusers.
To emulate conditions of heavy user load, you create a large number of Vusers that perform a
series of tasks. For example, you can observe how a server behaves when one hundred Vusers
simultaneously withdraw cash from the bank ATMs. To accomplish this, you create 100 Vusers, and each
Vuser:
Enters an account number into an ATM
Enters the amount of cash to withdraw
Withdraws cash from the account
Checks the balance of the account
Repeats the process numerous times
The actions that a Vuser performs during the scenario are described in a Vuser script. When you run a
scenario, each Vuser executes a Vuser script. The Vuser scripts include functions that measure and record
the performance of the server during the scenario. To measure the performance of the server, you define
transactions.
Transactions measure the time that it takes for the server to respond to tasks submitted by Vusers.
For instance, you can define a transaction that measures the time it takes for the server to process a
request to view the balance of an account and for the information to be displayed at the ATM. You insert
rendezvous points into Vuser scripts to emulate heavy user load on the server.
Rendezvous points instruct multiple Vusers to perform tasks at exactly the same time. For
example, to emulate peak load on the bank server, you insert a rendezvous point to instruct 100 Vusers to
simultaneously deposit cash into their accounts. You use the LoadRunner Controller to manage and
maintain your scenarios.
Using the Controller, you control all the Vusers in a scenario from a single workstation. When
you execute a scenario, the LoadRunner Controller distributes each Vuser in the scenario to a host. The
host is the machine that executes the Vuser script, enabling the Vuser to emulate the actions of a human
user. Vuser scripts include functions that measure and record system performance during load-testing
sessions. During a scenario run, you can monitor the network and server resources. Following a scenario
run, you can view performance analysis data in reports and graphs.
You can easily create and run load-testing scenarios by following the LoadRunner testing process
below. The following illustration outlines the testing process:
Successful load testing requires that you develop a thorough test plan. A clearly defined test plan
will ensure that the LoadRunner scenarios that you develop will accomplish your load testing objectives.
A scenario includes a list of machines that “host” Vusers; a list of Vuser scripts that the Vusers run; and a
list of Vusers that run during the scenario. You create scenarios using the LoadRunner Controller.
For each scenario, you create a list of hosts—machines configured to execute Vuser scripts. For
each scenario, you create a list of scripts that Vusers run during scenario execution.
You emulate user load on the server by instructing multiple Vusers to perform tasks
simultaneously. You can set the level of load by increasing and decreasing the number of Vusers that
perform tasks at the same time. Before you run a scenario, you set the scenario configuration. This
determines how all the hosts and Vusers behave when you run the scenario. You can run the entire
scenario, individual Vusers, or groups of Vusers (Vuser Groups). While a scenario runs, LoadRunner
measures and records the transactions that you defined in each Vuser script.
During scenario execution, LoadRunner records the performance of the client/server system under
different loads. You use LoadRunner’s graphs and reports to analyze the server’s performance.
LoadRunner replaces human users with virtual users or Vusers. Vusers emulate the actions of
human users by performing typical business processes. Each action that a Vuser performs submits input
to the client/server system. By increasing the number of Vusers, you increase the load on the system.
While a workstation accommodates only a single human user, many Vusers can run concurrently on a
single workstation.
To emulate conditions of heavy user load, you create a large number of Vusers that perform a
series of tasks. For example, you can observe how a server behaves when one hundred Vusers
simultaneously withdraw cash from a bank’s ATMs. Using LoadRunner, you divide your client/server
performance testing requirements into scenarios. A scenario defines the
events that occur during each testing session. Thus, for example, a scenario defines and controls the
number of users to emulate, the actions that they perform, and the machines on which they run their
emulations.
LoadRunner has a variety of Vuser types, each type suited to a particular load testing
environment. This enables you to use Vusers to accurately model and emulate real world situations. The
actions that a Vuser performs during the scenario are described in a Vuser script. The Vuser scripts
include functions that measure and record the performance of the server during the scenario. Each Vuser
type requires a particular type of Vuser script. Creating the Vuser scripts required for a scenario is part of
the LoadRunner testing process.
server load when using different types of client/server architectures. Each Vuser technology is suited to a
particular architecture, and results in a specific type of Vuser. For example, you use RTE Vusers to
operate terminal emulators; TUXEDO Vusers to emulate TUXEDO clients communicating with a
TUXEDO application server; Web Vusers to emulate users operating Web browsers. The various Vuser
technologies can be used alone or together, to create effective load testing scenarios.
The following table summarizes the use of the various Vuser types:
For QTP Documents visit: www.gcreddy.com
GUI Vusers
GUI Vusers operate graphical user interface (GUI) applications. These applications can run in
either the MS Windows or the X Windows environments. Each GUI Vuser that you develop emulates a
real user by submitting input to, and receiving output from, GUI applications. For example, a GUI Vuser
could operate Microsoft Paint as follows:
The operations that a GUI Vuser performs on an application are defined in a GUI Vuser script. You create
GUI Vuser scripts using Mercury Interactive’s GUI testing tools: WinRunner (for MS Windows
applications), and XRunner and VXRunner (for X Windows applications).
You can run only a single GUI Vuser on a Windows-based host. However, Mercury Interactive’s
Virtual X Server technology allows you to simultaneously run many GUI Vusers on a single UNIX host.
Database Vusers
Database Vusers generate load on a server by submitting input directly to the server. Database
Vusers do not operate client applications—they access the server using LoadRunner API functions. These
API functions emulate the input from an actual application.
Because Database Vusers are not reliant on client software, you can use Database Vusers to test server
performance even before the client software has been developed. Further, because Database Vusers do
not have a user interface, system resources are not used, and you can therefore run large numbers of
Database Vusers on a single workstation.
The following example illustrates the use of Database Vusers: Suppose that you have a database
server that maintains your customer information. The information is accessed by numerous customer
service personnel who are located throughout the country. The database server receives the queries,
processes the requests, and returns responses to field personnel. You want to test the response times of the
server when numerous service personnel simultaneously access the server. Using LoadRunner, you could
create several hundred Database Vusers, each Vuser accessing the server database. The Database Vusers
enable you to emulate and measure the performance of your server under the load of many users. You
develop a Database Vuser script to define the actions of a Database Vuser. A Database Vuser script
includes functions that control the script execution, specify the input that the Vuser submits to the server,
and measure the server performance.
You develop Database Vuser scripts either by recording with LoadRunner’s Vuser Script
Generator (VuGen) or by using LoadRunner’s Vuser script templates. For the database server example
above, you could create a Database Vuser script that performs the following actions:
For example, Database Vuser scripts always have three sections, are written in a code that resembles C,
and include SQL calls to a database server. In contrast, GUI Vuser scripts have only one section, and are
written in TSL (test script language). The following diagram outlines the process of developing a Vuser
script.
You begin the process of developing a Vuser script by recording a basic script.
LoadRunner provides you with a number of tools for recording Vuser scripts (see the table below
for a list of the tools).
You enhance the basic script by adding control-flow structures, and by inserting
transactions and rendezvous points into the script. You then configure the run-time settings. The
run-time settings include loop, log, and timing information, and define how the Vuser will
behave when it executes the Vuser script.
To verify that the script runs correctly, you run it in stand-alone mode. When your script
runs correctly, you incorporate it into a LoadRunner scenario.
The Vuser Script Generator, also known as VuGen, is LoadRunner’s primary tool for
developing Vuser scripts. VuGen is a Windows-based application that not only records scripts,
but also runs them. Running scripts from VuGen is useful when debugging. It enables you to
emulate how a Vuser script will run when executed in a LoadRunner scenario from the
Controller.
the script. These functions include general Vuser functions and protocolspecific functions. The general
Vuser functions, also known as LR functions, allow you to obtain information about Vusers running in a
scenario. The protocol-specific functions are specific to the Vuser type. For example, VuGen inserts LRT
functions into a TUXEDO script, and LRS functions into a Windows Sockets script.
You use VuGen to develop a Vuser script by recording a user performing typical business processes on a
client application. VuGen creates the script by recording the activity between the client and the server.
For example, in database applications, VuGen monitors the client end of the database and traces all the
requests sent to, and received from, the database server.
Instead of manually creating a Vuser script by programming the
application’s API function calls to the server, you use VuGen to:
VuGen greatly simplifies the task of creating Vuser scripts by reducing the need for manual
programming. Each Vuser script that you create with VuGen can communicate directly with a server by
executing calls to the server API— without relying on client software. You can therefore use Vusers to
check server performance even before the user interface of the client software has been fully developed.
are not used on a user interface. This lets you run a large number of Vusers simultaneously on a single
workstation. This in turn allows you to use only a few testing machines to emulate large server loads.
VuGen enables you to create a Vuser script by recording actions from an application. When you
run the recorded script, it emulates activity between the client and server. VuGen eliminates the need to
manually program Vuser scripts. Each Vuser script that you create using VuGen contains three sections:
vuser_init, Actions, and vuser_end. During recording, you can select the section of the script into which
VuGen will insert the recorded functions.
In general, you record a log in to a server into the vuser_init section; client activity into
the Actions section; and the logoff procedure into the vuser_end section. While recording, you
can insert transactions and rendezvous points.
Before you begin recording, you must create a Vuser script. If you are recording a Java,
Baan, or RTE application, you can also record into an existing script.
Select Start > Programs > LoadRunner > Virtual User Generator.
The VuGen window opens
Recording with VuGen
Click the New button. The New Virtual User dialog box opens with a list
of the supported Vuser script types