Sei sulla pagina 1di 9

Load Runner

Load Runner is a performance testing tool.


It also does functional testing.

Load Runner has 4 components:

 Virtual User Generator (VUGEN)


 Controller
 Analysis
 Load Generator.

1) VUGEN:
VUGEN is where we
a) Record, b) Run, c) Debug & d) Design.
They are called Vuser scripts.

2) Controller:
Controller is where we apply the load. The Controller organizes drives, manages
and monitors the load test.

3) Analysis:
Analysis is where we analyze the performance results.

4) Load generator/Launcher:
It is the local host [which is CPU]. Load generator generates the load by running
virtual users.

Load Runner has 2 views:

1) Script view
2) Tree view: It has 2 vies as well:- a) Page view & b) HTML view

To start:
 Go to Programs
 Load Runner
 Virtual User Generator
 Click on “New file”
 Expand E Business
 Select “Web(HTTP/HTML)”
 Click “OK”
 Highlight “Action”
 Click “Record”
 Type URL[www.Macy’s.com]
 Click “OK”

Then run from the top. Result summary appears. Status =”Passed”.
On the left window expand the “Iteration” to watch the screens. Then close the result
window.
Delete cookies and design.
To design we have write “Comments” and “Start” and “End” transactions.
To write comments:
 Go to “Insert”
 Click on “Comment” and write the comment
E.g. “Type www.Macy’s.com.” and the main page of Macy’s will open.”
Then click on the icon “Start transaction” and write “Macy’s” and enter. At the end of
that script click on the icon “End transaction” and it will automatically have “Macy’s”,
just enter. Similarly we have to do it to every link. After we are done we have to run
again and save the test case with a name.

Toggle Break point

Using the Toggle Break point we can stop the script where ever we want. But it has some
limitations. We can use TBP only before “web_url” & “web_ txt”. Using the Toggle
Break point we can do line by line debugging. After debugging we design the script.

There are 3 kinds of errors:

1) Syntax error: [ , ; : “ ) ] etc.


2) Runtime error: Spelling error.
3) Compiling error:

Syntax error and Runtime error are tester’s responsibility.


Compiling error is programmer’s responsibility.
Toggle Break point is only for Runtime error. The TBP looks like a hand symbol. If we
put TBP anywhere besides web_url or web_txt the system won’t recognize it and it will
run through without stopping. After designing we can put Toggle Break Point before
“LR_start_transaction”. If we put TBP before “LR_end_transaction” it will work but it is
better to stop it at start. Sometimes we are not sure about some scripts whether to delete it
or not. In that case first put it under comment and run. If it works then delete it. By using
TBP we can do line by line debugging. Toggle Break Point is only for runtime error.
We can check the Pass/Fail log in the “Replay log”.

Multiple actions:
In Load Runner we have multiple actions. We can make one long script but break it up
into “Action1”, “Action2 etc. to make our job easy. Every time we start a new action
while recording that we can click on to the icon “New action” and start another action in
it.
Vuser_init = Vuser initialization. It logs on procedure to the server.
Vuser_end = Logs off procedures to the server.
In between the Vuser_init & Vuser_end the “Action” is included.

An example of multiple actions:


In VUGEN open a new file
 Click on “Record”
 Type www.yahoo.com
 Click on “Autos”
 Click on “New cars”
 Click on “BMW”
 Click on to the icon “New action” and it becomes “Action1”
 Click on “Used cars”
 Click on “Acura”
 Click on to the icon “New action” and it becomes “Action2”
 Click on “Sell my car”
 Click on “Blue book”
 Stop

To give a name to the “Action”, highlight, right click, delete and type the new name.

Integration Testing

To integrate tests:
 Click on “Action”
 “Import action into the Vuser” and you get the window
 Click on “Browse”
 Highlight the Vuser script you want and
 Click “Open”
 Highlight the “Action” name and click “OK” and it will come there.

Keep doing until you have integrated all the “Actions” and then “Run”.

Parameterization
Definition:

Replacing the original value with a different value and the value that you are
replacing has to be in the database.
In the Vuser:
 Click on “Record”
 Type URL www.Walmart.com
 Click “OK”
 When the main page of Walmart opens go to the “zip code” box and enter
a valid zip code [08648].
 Click “Stop”
 Click on “Run”

Open the scripts.


 Then go to “Edit”
 Click on “Find”
 Type the zip code value [08648] that you put in the find box.
 Click “Find” and the value will be highlighted.
 Right click on the highlighted value
 Click on “Replace with a parameter”
 In the window delete “New param” then,
 Enter the parameter name which is “zip code”
 Click “OK”

The value will turn into Purple color.


 Highlight the text in the braces and right click
 Click on “Parameter properties” and a window will come up
 Click on “Edit” and it will take you to “Note pad”

Enter the values there in the “Note pad” positive and negative:
e.g. [07028, 12345, 07003, 07306, $%^&*]
 Then press “Enter”
 Click on “File”,-“Save”
 Click on “File”,-“Exit”
 Click on “Close” on the window
 Go “Vuser”
 Click on “Run time settings”
 Click on “Run Logic” and increase no: of iterations [as many zip codes that many
iterations ]
 Click on “Log”
 Click on “Extended Log”
 Check “Parameter substitution”
 Click “OK”
 “Run”

For every zip code a different location of Walmart page will appear and for the negative
value it should say “Please enter a valid zip code”.
Test data will be provided to the company by the end client. Dummy data will be created
by the software development company.

Correlation

Using “Correlation” we can capture the dynamically generated value from the server.
Option: Scan for “Correlation”
We only get “Correlation No:” for mail order stores.

Example:
 Click on www.Landsend.com
 Click on “OK”
 Click on “Request a catalogue”
 Click on “Our stores”
 Click on “Guaranteed period”
 Click on “Stop” and then “Run” the script.

Delete the cookies, then “Comment” and “Design”.


Without running the script it won’t allow us to “Correlate”.
Correlation number is the tracking number or PNR No:
 Go to “Vuser”
 Click on “Scan script for correlation”
 Go to “View”
 Go to “Script view”
In the correlation result highlight the dynamically generated value and Click “Correlate”.
Automatically it will write the code.
 Go to “View”
 Go to “Script view”
 Copy it and paste it in the “Note pad”
 Copy “WCSParam_Diff1” and
 “Edit”
 “Find”
 “Run”
 Go to “Vuser”
 Click on “Runtime setting”
 Check “Extended log
 Check “Parameter substitution”
 Check “Data returned by the server”
 Check “Advanced Trace”
 “OK”
 “Run”
To have a certain “a no:” the previous no: has to be hard coded by the programmer.
“WCSParam_Diff1” is the parameterized name for correlation number given by the
system by default.
WCS = Web Correlation Studio
Controller

We will apply the load here. In Controller we test by increasing the load gradually until it
meets the demand and still works.

 Load
 Stress
 Performance

Load Balancing: How to increase/decrease the load.

Start>Programs>Load Runner>Controller:

We have 2 kinds of scenarios.


1) Manual scenario
2) Goal oriented scenario

Steps:

Go to:
 Programs
 Load Runner
 “Controller”
 New scenario:
 Any available scripts
 Add to script scenario
Available scripts will be added to scenario.
 OK

You will be in “Scenario schedule”


Go to Vuser and reduce the quantity
 Close
 Click on “Edit schedule”

It will take you to “Schedule Builder”. On “Default schedule” click “New”.


Name the “……..schedule” then click “OK”
Initialize all users and click “OK”
Click on “Start scenario” to run
Click on “Vusers” to see individually
Click on “Yes”
To check the result:
 Go to “Results”
 Click on “Analyze results”
 Go to “Reports”
 Click on “Detailed Transactions”

To add more Vusers:


 Go to “Design tab” of “scenario schedule”
 Click on Vuser
 Click on “Reset”
 Click on “Add Vuser”
 Select the quantity to add
 Click “OK”
 Click on “Start scenario”
 Click on “Yes”
 Click on “Vusers”

Close the window after it is passed.


 Go to “Results”
 Analyze results

Analysis summery: See the total hits and the number of users we had. Then divide the
total hits by the number of users and that will give us the hits per user.

To add more users:

 Click on “Design” in Scenario schedule


 Click on “Vuser”
 Click on “Reset”
 Click on “Add user”
 Select the quantity to add
 Click “OK”
 Click on “Start scenario”
 Click on “Yes”

Close the window after it has passed.


 Go to “Results”
 “Analyze results”
 In “Analysis summary” see the total hits and calculate the hits with the previous
hit values.
 i.e. Total hit values/Number of users= Hits per users
Load setting differently

1) Standard Load/Flat load:

To set the load differently: Schedule by group scenario is used.


 Go to “Schedule builder
 Click on “Edit”
 Click on “Scenario schedule”
 Click on “Edit schedule”
 Click on “Schedule builder”

Change from “Load all virtual users simultaneously” to option 2: Load virtual users every
15 seconds.
 Click on “Start scenario”
 Click on “Yes”

Then check the results. This testing is “Standard load or Flat load”

Customized load

In this scenario Vusers are scheduled by group.


Go to:
 Programs
 Load Runner
 Controller

Add any script. Add as many as you want and say “OK”.
In “Scenario group” highlight the particular group name and click on “Vusers”. Keep as
many as you want and then close. Repeat the procedure the for everyone .
 Click on “Edit schedule”
 Click on “Schedule by group”
 Initialize all the users before ramp up.
 Click “OK”
 Click “Start scenario”
 Click “Yes”
 Click “Vusers”

Check the result in “Analysis”.

Rendezvous
We use this option to check the peak load from off peak load. We instruct virtual users to
wait during test execution for multiple Vusers to arrive at a certain point before
execution.
Steps to apply Rondezvous:

 Open the existing Vuser script.


 Take the curser to the link where you want to apply the “Rondezvous”.
 Go to “Insert” and
 Click on “Rondezvous”

You will get a box. Enter a meaningful Rondezvous name.


 Click “OK”
 Click on “Save”
 Then “Run”
 Go to “File”>”Exit”

Open the controller and click on “Vuser”. Then reduce the quantity and edit schedule.
 Take the first option [simultaneously] and say “OK”.
 Click on “Start scenario”
 Go to “Details”
 Analyze results.

If you see that certain number of users arrived at the same point and the page
opened in less than 8 seconds then it is successful.

Potrebbero piacerti anche