LOADRUNNER Interview Questions & Answers

burgerraraΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

124 εμφανίσεις




LOADRUNNER Interview Questions &
Answers


What is load testing?




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.



What is Performance testing?





Timing for both read and update transactions should be gathered to determine whether
system functions are being performed in an acceptable timeframe. This should be done
standalone and then in a multi user
environment to determine the effect of multiple
transactions on the timing of a single transaction.



Explain the Load testing process?



Step 1: Planning the test.
Here, we develop a clearly defined test plan to ensure the test
scenarios we develop will a
ccomplish 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 descri
bes 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 man
ual 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
auto
matically 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 scen
ario, 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 differen
t
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 compl
ex. 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.


What are the components of LoadRunner?





The components of LoadRunner are The Virtual User Generator, Controller, and the Agent
process, LoadRunner Analysis and Monitoring, LoadRunner Books Online.



What

Component of LoadRunner would you use to record a Script?



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 rendezvous point?





You insert rendezvous points

into Vuser scripts to emulate heavy user load on the server.
Rendezvous points

instruct Vusers to wait during test execution for multiple Vusers to arrive
at a certain point, in or
der that they may simultaneously perform a task. For example, to
emulate peak load on the bank server, you can insert a rendezvous point instructing 100
Vusers to deposit cash into their accounts at the same time.


What is a scenario?





A scenario defin
es 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.


Explain the recording mode f
or web Vuser script?





We 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 web bas
ed applications, VuGen monitors the client
end of the database and traces all the requests sent to, and received from, the database
server. We use VuGen to: Monitor the communication between the application and the
server; Generate the required function ca
lls; and Insert the generated function calls into a
Vuser script.


Why do you create parameters?



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 eac
h 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 corre
lation?





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 corre
lation 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 Nu
mber, 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.



Where do you set automatic correlation options?





A
utomatic correlation from
web point of view

can be set in recording options and
correlation tab. Here we can enable correlation for the entire script and choose either issue
online messages or offline actions, where we can define rules for that correlation
. Automatic
correlation for database can be done using show output window and scan for correlation and
picking the correlate query tab and choose which query value we want to correlate. If we
know the specific value to be correlated, we just do create corr
elation for the value and
specify how the value to be created.



What is a function to capture dynamic values in the web Vuser script?

-



Web_reg_save_param function saves dynamic data information to a parameter.



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

E
xtended 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 ad
ditional information should be added to the
extended log using the Extended log options.



How do you debug a LoadRunner script?



VuGen contains two options to help debug Vuser scripts
-
the Run

Step

by

Step command
and breakpoints. The Debug settings in th
e Options dialog box allow us to determine the
extent of the trace to be performed during scenario execution. The debug information is
written to the Output window. We can manually set the message class within your script
using the lr_set_debug_message fun
ction. This is useful if we want to receive debug
information about a small section of the script only.


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 functio
ns 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 (dllexpo
rt) 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.


What are the changes you can make in run
-
time settings?





The Run Time Se
ttings that we make are: a)

Pacing

-

It has iteration count. b)
Log
-

Under this we have Disable Logging Standard Log and c)
Extended

Think Time

-

In think
time we have two options like Ignore think time and Replay think time. d)
General

-

Under
general ta
b we can set the vusers as process or as multithreading and whether each step as
a transaction.



Where do you set Iteration for Vuser testing?



-

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.



How do you perform functional testing under load?





Functionality under load can be tested by running several

Vusers concurrently. By
increasing the amount of Vusers, we can determine how much load the server can sustain.



What is Ramp up? How do you set this?





This option is used to gradually increase the amount of Vusers/load on the server. An initial
value

is set and a value to wait between intervals can be

specified. To set Ramp Up, go to ‘Scenario Scheduling Options’



What is the advantage of running the Vuser as thread?





VuGen provides the facility to use multithreading. This enables more Vusers to b
e run per

generator. If the Vuser is run as a process, the same driver program is loaded into memory
for each Vuser, thus taking up a large amount of memory. This limits the number of Vusers
that can be run on a

single

generator. If the Vuser is run as a t
hread, only one instance of the driver program is loaded
into memory for the given number of

Vusers (say 100). Each thread shares the memory of the parent driver program, thus
enabling more Vusers to be run per generator.



If you want to stop the executio
n of your script on error, how do you do that?



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 y
ou 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.





What is the relation between Response Time and Throughput?





The Throughput graph shows the amount of data in bytes that the Vusers received from the
server in a second. When we compare this with the transaction response time, w
e will notice
that as throughput decreased, the response time also decreased. Similarly, the peak
throughput and highest response time would occur approximately at the same time.


Explain the Configuration of your systems?





The configuration of our sys
tems refers to that of the client machines on which we run the
Vusers. The configuration of any client machine includes its hardware settings, memory,
operating system, software applications, development tools, etc. This system component
configuration shou
ld match with the overall system configuration that would include the
network infrastructure, the web server, the database server, and any other components
that go with this larger system so as to achieve the load testing objectives.



How do you identify
the performance bottlenecks?




Performance Bottlenecks can be detected by using monitors. These monitors might be
application server monitors, web server monitors, database server monitors and network
monitors. They help in finding out the troubled area
in our scenario, which causes increased
response time. The measurements made are usually performance response time,
throughput, hits/sec, network delay graphs, etc.



If web server, database and Network are all fine where could be the problem?




The probl
em could be in the system itself or in the application server or in the code written
for the application.



How did you find web server related issues?




Using Web resource monitors we can find the performance of web servers. Using these
monitors we can a
nalyze throughput on the web server, number of hits per second that

occurred during scenario, the number of http responses per second, the number of
downloaded pages per second.



How did you find database related issues?



-

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


Explain all the web
-
recording options?


What is the difference between Overlay graph and Correlate graph?

-

Overlay
Graph
:



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. Tas
k 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 a
nd their priority levels with regard to the scenario we are deciding.


What does vuser_init action contain?




Vuser_init action contains procedures to login to a server.



What does vuser_end action contain?





Vuser_end section contains log off
procedures.





What is think time? How do you change the threshold?




Think time is the time that a real user waits between actions. Example: When a user
receives data from a server, the user may wait several seconds to review the data before
responding.

This delay is known as the

think time.

Changing the Threshold: Threshold level
is the level below which the recorded think time will be ignored. The default value is five (5)
seconds. We can change the think time threshold in the Recording options of the
Vugen.



What is the difference between standard log and extended log?




The standard log sends a subset of functions and messages sent during script execution to a
log. The subset depends on the Vuser type

Extended log sends a detailed script execution
m
essages to the output log. This is mainly used during debugging when we want
information about: Parameter substitution. Data returned by the server. Advanced trace.


Explain the following functions:





lr_debug_message

-

The lr_debug_message function sen
ds a debug message to the
output log when the specified message class is set.
lr_output_message

-

The
lr_output_message function sends notifications to the Controller Output window and the
Vuser log file.
lr_error_message

-

The lr_error_message function se
nds an error message
to the LoadRunner Output window.
lrd_stmt

-

The lrd_stmt function associates a character
string (usually a SQL statement) with a cursor. This function sets a SQL statement to be
processed.
lrd_fetch

-

The lrd_fetch function fetches the

next row from the result set.

Throughput

-

If

the throughput scales upward as time progresses and the number
of Vusers increase, this indicates that the bandwidth is sufficient


If the graph

were to remain relatively flat as the number of Vusers
increased, it would be
reasonable to conclude that the bandwidth is constraining the volume of

data delivered.




T
ypes of Goals in Goal
-
Oriented Scenario




LoadRunner provides you with five different types of goals in a goal
-
oriented scenario
:

The numbe
r of concurrent Vusers

The number of hits per second

The number of transactions per second

The number of pages per minute

The transaction response time that you want your scenario


Analysis Scenario (Bottlenecks):



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 5
6 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 simultaneou
sly.



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 va
lue 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.


Where do you set automatic correlation options?





Automatic correlation from web point of view, can be set in recordi
ng options and
correlation tab. Here we can enable correlation for the entire script and choose either issue
online messages or offline actions, where we can define rules for that
correlation.

Automatic correlation for database, can be done using show out
put window and
scan for correlation and picking the correlate query tab and choose which query value we
want to correlate. If we know the specific value to be correlated, we just do create
correlation for the value and specify how the value to be created.





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)


We
can install LoadRunner in 2 ways 1) LoadRunner full installation 2) Load Generator
Installation


LoadRunner is a protocol based test tool, where as QTP is a object based test tool. We can select
single or multiple protocols.


LoadRunner was developed by Me
rcury Interactive in 1990s, later takeover by HP in 2007.


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),
Borla
nd
-
Silk Performer, QAWebload, Jmeter etc…


LoadRunner has 3 external components and one internal component


External Components:

1) VUser Generator (Virtual user generator)


2) Controller


3) Analysis


Internal Components:


1) Remote Agent Process


1)
Vuser Generator: It is used for Scripts generation, editing and deletion.


LoadRunner Script divided into 3 parts


a) VUser
-
init (for recording application launching operation)


b) Action (for recording main action to be tested)


c) VUser
-
end (for recordin
g application closing operation)


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:
I
t 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:


Ge
neral schedule:


Starting all vusers at a time and closing all at a time.


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 schedu
le we start all vusers at a time and we stop vusers step by step (Example 100 users
for every 10 seconds)


Ramp
-
up and Ramp
-
down:


In this schedule, we start and stop vusers step by step, means:


Start some number of vusers for a specified time (Example 10
0 users for every 10 seconds)


Stop some number of vusers for a specified time (Example 100 users for every 10 seconds)


Endurance Testing:


Applying continues load for a specific period of time


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 Cryst
al
Reports.


After analyzing the Results we can send Defects


For QTP Documents visit: www.gcreddy.com

It is expensive,
requiring large amounts of both personnel and


machinery

It is complicated, especially coordinating and synchronizing multiple


testers

It involves a high degree of organization, especially to record and


analyze results meaningfully

The repeatabilit
y of the manual tests is limited


The LoadRunner Solution

The LoadRunner automated solution addresses the drawbacks of

manual performance testing:

LoadRunner reduces the personnel requirements by replacing human


users with virtual users or Vusers. The
se Vusers emulate the behavior

of real users

operating real applications.

Because numerous Vusers can run on a single computer, LoadRunner


also reduces the hardware requirements.

The LoadRunner Controller allows you to easily and effectively control


all the Vusers

from a single point of control.

LoadRunner automatically records the performance of the client/server


system during a test. You can choose from a wide variety of graphs

and reports how you want to view the performance data.

LoadRunner

checks where performance delays occur: network or client


delays, CPU performance, I/O delays, database locking, or other issues

at the database server.

LoadRunner monitors the network and server resources to help you


improve performance.

Because Lo
adRunner tests are fully automated, you can easily repeat


them as many times as you need.

Understanding LoadRunner • Introduction Using LoadRunner

Using LoadRunner, you divide your client/server performance testing requirements into
scenarios. A scenari
o 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.

Testing Tools


LoadRunner

# 2 #

For QTP Documents visit: www.gcreddy.com

To emulate conditions of heavy user load, you create a large number of Vusers that perfo
rm 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 a
mount 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 scenari
o. 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 se
rver 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 sc
enarios.

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, enabl
ing 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.

The LoadRunner Testing Process

You can easily create and run load
-
testing scenarios by following the LoadRunner testing process
below. The following illustration outlines the testing process
:

Testing Tools


LoadRunner

# 3 #


For QTP Documents visit: www.gcreddy.com

Step I: Planning the Test

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.

Step II: Creating the Vuser scripts

Vusers emulate human users interacting with your client/server

system. A Vuser

script contains the actions that each virtual user performs during scenario

ex
ecution.

In each Vuser script you determine the tasks that will be:

Performed by each Vuser

Performed simultaneously by multiple Vusers

Measured as transactions

Step III: Creating the Scenario

A scenario describes the events that occur during a clien
t/server

testing session.

Testing Tools


LoadRunner

# 4 #

For QTP Documents visit: www.gcreddy.com

It is expensive, requiring large amounts

of both personnel and


machinery

It is complicated, especially coordinating and synchronizing multiple


testers

It involves a high degree of organization, especially to record and


analyze results meaningfully

The repeatability of the manual tests
is limited


The LoadRunner Solution

The LoadRunner automated solution addresses the drawbacks of

manual performance testing:

LoadRunner reduces the personnel requirements by replacing human


users with virtual users or Vusers. These Vusers emulate the
behavior

of real users

operating real applications.

Because numerous Vusers can run on a single computer, LoadRunner


also reduces the hardware requirements.

The LoadRunner Controller allows you to easily and effectively control


all the Vusers

from a

single point of control.

LoadRunner automatically records the performance of the client/server


system during a test. You can choose from a wide variety of graphs

and reports how you want to view the performance data.

LoadRunner checks where performa
nce delays occur: network or client


delays, CPU performance, I/O delays, database locking, or other issues

at the database server.

LoadRunner monitors the network and server resources to help you


improve performance.

Because LoadRunner tests are ful
ly automated, you can easily repeat


them as many times as you need.

Understanding LoadRunner • Introduction Using LoadRunner

Using LoadRunner, you divide your client/server performance testing requirements into
scenarios. A scenario defines the events t
hat 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.

Testing Tools


LoadRunner

# 2 #

For QTP Documents visit: www.gcreddy.com

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 duri
ng 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 s
erver, 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
e
xample, 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 co
ntrol 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 a
nalysis data in reports and graphs.

The LoadRunner Testing Process

You can easily create and run load
-
testing scenarios by following the LoadRunner testing process
below. The following illustration outlines the testing process:

Testing Tools


LoadRunne
r

# 3 #


For QTP Documents visit: www.gcreddy.com

Step I: Planning the Test

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.

Step II: Creating the Vuser scripts

Vusers emulate human users interacting with your client/server

system. A Vuser

script contains the actions that each virtual user performs during scenario

execution.

In each Vuser script you determine the tasks that will be:

Performed by each Vuser

Performed simultaneously by multiple Vusers

Measured as transactions

Step III: Creating the Scenario

A scenario describes the events that occur during a client/server

testing session.

Testing Tools


LoadRunner

# 4 #


For QTP Documents visit: www.gcreddy.com

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.

Creating the List of Hosts to Run Vusers

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.

Creating the Vusers

To each Vuser in a scenario, you assign a Vuser script
and a host to run

the script.

Step IV: Running the Scenario

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). Wh
ile a scenario runs, LoadRunner
measures and records the transactions that you defined in each Vuser script.

Step V: Analyzing Test Results

During scenario execution, LoadRunner records the performance of the client/server system under
different loads. Y
ou use LoadRunner’s graphs and reports to analyze the server’s performance.

LoadRunner Vuser Technology

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 workst
ation.

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 LoadRunne
r, you divide your client/server
performance testing requirements into scenarios. A scenario defines the

Testing Tools


LoadRunner

# 5 #







For QTP Documents visit: www.gcreddy.com

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.

Developing Vuser Scripts

LoadRunner has a vari
ety 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 proc
ess.

Developing Vuser Scripts
-

Looking at Vuser Types

LoadRunner provides a variety of Vuser technologies that enable you

to generate

server load when using different types of client/server architectures. Each Vuser technology is suited to a
particula
r 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 browse
rs. 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 a
pplications. For example, a GUI Vuser
could operate Microsoft Paint as follows:

1. Select Open from the File menu.

2. Select a graphic file called test.bmp.

3. Click the Open button.

4. Select Flip/Rotate from the Image menu.

5. Click the Flip Horizontal
radio button.

6. Click the OK button.

7. Select Save from the File menu.

Testing Tools


LoadRunner

# 7 #




For QTP Documents visit: www.gcreddy.com

The operations that a GUI Vuser performs on an application are defined in a GUI Vuser script. You crea
te
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.

Testing Tools


LoadRunner

# 8 #








For QTP Documents visit: www.gcreddy.com

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 u
sed, 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 acc
essed 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 th
e 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 serve
r 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 pe
rforms the following actions:

Connects to the server

Submits an SQL query

Retrieves and processes the server response

Disconnects from the server

Developing Vuser Scripts

The structure and content of a Vuser script differ from one Vuser type

to anot
her.

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). T
he 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

tim
ing 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.





Working

with VuGen


Introducing VuGen

About VuGen

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 script
s 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.

Note: VuGen records sessions on Windows platforms only. However, a

recorded Vuser script can run on e
ither a Windows or a UNIX platform. When

you record a Vuser script, VuGen generates and inserts various functions into




For QTP Documents visit: www.gcreddy.com

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 specif
ic to the Vuser type. For example, VuGen inserts LRT
functions into a TUXEDO script, and LRS functions into a Windows Sockets script.

The general Vuser functions and the protocol
-
specific functions

together form the

LoadRunner API and enable Vusers to c
ommunicate directly with a server.

Recording Vuser Scripts with VuGen

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 th
e 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:

Monitor the communication between the application and the server

Generate the required function calls

Insert the generated function calls into a Vuser script

VuGen greatly simplifies th
e 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 us
e Vusers to
check server performance even before the user interface of the client software has been fully developed.



For QTP Documents visit: www.gcreddy.com

In addition, when a Vuser communicates directly with a server, system

resources

are not use
d 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.

About Recording with VuGen

VuGen enables you to create a V
user 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 i
nto
the Actions section; and the logoff procedure into the vuser_end section. While recording, you
can insert transactions and rendezvous points.

Creating a Vuser Script

Before you begin recording, you must create a Vuser script. If you are recording a J
ava,
Baan, or RTE application, you can also record into an existing script.

To create a new Vuser script:

Start VuGen




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


Select a Vuser script type and then click OK.


Recording Vuser Scripts

The recording procedure differs slightly between protocols. For Baan

and Java

Vusers
. For all other Vusers types, see the section below.

To record for APPC, Database, TUXEDO, or Windows Socket Vusers:



For QTP Documents visit: www.gcreddy.com

If the Start Recording dialog box is not open, click the Start Recording


button. The Start
Recording dialog box opens