Thursday, July 19, 2007

Loadrunner complete flow with steps and examples

Business analyst interview questions tutorials jobs

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 http://www.macy/.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 http://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 http://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 http://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.

Tuesday, July 17, 2007

what are vuser_init(), vuser_end(), action ?

The set of things that needs to be done as soon as user enters the website/application will be done in vuser_init.

What user will do after entering into the website/application will be done in action().

what should be happened just before user leaves the website/closing the application will be done in vuser_end()

how to parameterise the transaction name

lr_start_transaction(lr_eval_string("{parameter_transaction_name}")).

different types of monitors in load runner

There are many types of monitors in load runner. Basically monitors are ussed to find out the bottle necks in response times by the servers. these servers can be web server, application server, network server, database server etc...

so monitors for all these servers are available to find out the response times and by then we can find out in whci area the problem is.

How to increase the wait time in load runner?

I am trying to increase the wait time in load runner controller from default 180 sec to 999 sec. But still it is getting timed out in 180 sec. how to solve this?

go to vugen----run time setting----preferences-----options and do the necessary changes. like http request time out = 999


or


1. Modify Mercury InteractiveLoadRunnertemplateqtwebdefault.cfg. Insert the following:
[web]
ReceiveTimeout=10000
2. Modify Mercury InteractiveLoadRunnerdatWebAdvancedOpt.txt. Change:
[LIST]
1=”T_COMBOBOX;Web;EnableIPCache;DNS caching;Save a host’s IP address to a cache to conserve time in
subsequent calls to the host.;1;Yes;
2=”T_COMBOBOX;Web;HTTPVer;HTTP version;Indicates the version of HTTP used by your application. Select version
1.0 or 1.1.;1;1.1;<1.0;1.1>”
3=”T_COMBOBOX;Web;KeepAlive;Keep-Alive HTTP connections;Allow persistent HTTP connections to enable multiple
requests to be sent over the same TCP connection.;1;Yes;
4=”T_EDIT_NUM;Web;MaxConnections;Concurent connections limit;Sets the maximum number of simultaneous keepalive
connections that a Vuser can maintain during script execution;1;4;<0;10>”
5=”T_EDIT_NUM;Web;ConnectTimeout;Connect timeout (seconds);The maximum amount of time in seconds, that aVuser waits to connect to a server, before issuing an error.;1;120;<0;10000>”
6=”T_EDIT_NUM;Web;ReceiveTimeout;Receive timeout (seconds);The maximum amount of time in seconds, that aVuser waits to receive information from a server, before issuing an error.;1;120;<0;10000>”
7=”T_EDIT_NUM;Web;NetBufSize;Network buffer size; Sets the maximum number of the network buffer that may be
used by the Vuser. The default is 12288 bytes.;1;12288;<0;100000>”
8=”T_COMBOBOX;Web;CacheAlwaysCheckForNewerPages;Cache-Emulate always check for newer
pages;;1;Yes;
9=”T_EDIT_NUM;Web;PageDownloadTimeout;Page download timeout(seconds);;1;120;<0;32000>”

how to analyse online monitors

you can analyse the online monitors in controller, after running the senario u can analyse the results in analysis.

how to capture dynamically generated values by the server

You cAN CAPTURE dynamically generated values by the server by using the function called
web_reg_save_param("parameter name", "lb=", "rb=", "ord=", last)

which protocal for windows application?

either winsocket or com/dcom

what are the components of load runner

virtual user generator, controller, analysis, agent process etc

what is the difference between lr_endtranscation("transcationname",lr_auto)

You can manually set the status of the transaction or you can allow LoadRunner to detect it automatically. To manually set the status, you perform a manual check within the code of your script evaluating the return code of a function. For the "succeed" return code, set the status to LR_PASS. For a "fail" return code, set the status to LR_FAIL.If status is LR_AUTO, then the value of status is automatically assigned by LoadRunner.For example: Just calling a function to a variable sstatus = CheckString() //return 0 if passed
if(sstatus==0)
lr_end_transaction("parent handle",LR_PASS)
else
lr_end_transaction("parent_handle",LR_FAIL)

What is the meaning of 'think time' in load runner?

Think time is the time where user waits between each action. Say if user clicks on a web page link and he waits (idle state) till the page loads. Or time taken after a mouse click to give the results in the same/new page.

what is the parameterisation process in load runner?

Select the variable which you want to do parameterisation, right click on that and select 'replace with parameter', click on properties, create table button, enter name of the parameter, select "next row", select newxt row if u want, update..click next, close..

to add load generator we need to give a name. Why?

The name we give indicates the system IP address to connect to the load generator.
It can be relote host or local host.

what is analysation reports in Load runner?

Analysation reports means report that gives details about the performance of the application under certain load. It represents in graphical representation.

It gives clear idea of response times taken by the server for the queries.

Load runner supports which language?

Loadrunner uses TSL (test script language) for scripts which is written in C language.
But if u select any function and press f1 then it gives an option to open in Java, vb etc..

How to do performance testing for a client server application?

First we need to know the number fo users who r going to work on that application.

Should understand the peak load of the application. I.e at what load the application will go to dump/crash etc...

Band width/ network speed etc..

The kind of actions most frequently used by users..

All these things have to be considered while doing settings in controller.

can we run qtp scripts in load runner?

Yes we can run qtp scripts in loadrunner.
In the controller just select the qtp scripts and build the scenario and run it. Load runner runs the script as it runs the vugen scripts.

3. In which scenario you would like to parameterize a text verification check?

Text verification will be done for correctness of results of final process. For ex after sign off from a site you may get a conformation message saying ‘you have been signed off’. To check if this message is as expected, we do text verification check.

2. What if your V user script has dynamic values that are depending on parameterization?

We can use the extended logging option for reporting.
Also check for co relation in the script.

1. What are the uses of creating multiple actions by virtual user script(v user script)?

Advantages are Reusability, repeatability, reliability.
Also if the code in load runner goes beyond 1 lack lines, we get a compiler error, so we need to split the code into multiple actions.

If we split the code into actions, it will be easy to do any modifications if needed.
Ex: login action, delete action, credit card processing, etc