Action files in Loadrunner The requests which agents on host machines issue to application servers are specified by a playback of actions created by the Vuser User Generator (VuGen.exe).LoadRunner creates new scripts with three sections: vuser_init: Most of the initiation operations are done with vuser_init action. We need to execute login only once if we are simulating shift duration. Here login related operations needs to be recorded. Since the bank executives login only once in their shift. Action: All other bank executive repeated operations needs to be captured. And the login and logout operations should not be captured into action. vuser_end: Most of the closure operations are done with vuser_end action. Here logout related operations needs to be recorded. Since the bank executives logout only once after his / her shift. Loadrunner Interview Questions - Part IV1.How many types of Correlation are there? Correlation can be done by 3 ways: 1.Manual Correlation ( this method is most recommended) 2.Automatic Correlation (This requires rules need to be created in existing rule engine, this can apply only to popular and frequent dynamic values like viewstates in .Net applications) 3.Correlation Studio 2.How you will do the manual Correlation?1.Record two identical scripts with the same business process, make sure to use same input data like user names and search strings 2.Compare the scripts to identify the dynamic value, You can compare them using notepad or keeping side by side or using windiff or any text comparison tools. the mainly you have to look at ITEMDATA section and URL ending part. Once you identified which value is changing every time 3.Search for the dynamic values in the Generation log and Copy Left boundary (LB) and Right boundary (RB) into notepad 4.Replay the script with extended log and look for those boundaries in replay log and Double click in the replay log where the boundaries are found and it will take the cursor to the point where dynamic value is generating in the recorded script. Thi s step is to identify from which request this value is generating and this will help us to identify the location to keep web_reg_save_param function. 5.Insert web_reg_save_param("Param name", "LB=" , "RB=", LAST) ; where the cursor is pointing 6.Replace the dynamic values with Param name 3.How you will do the parameterization for Date/Time? Select the parameter type as Date/Time and select the date/time format in the list. If you want u can get the date in the script by using "lr_save_datetime("Tomorrow is %B %d %Y", DATE_NOW + ONE_DAY, "next"); " 4.How many areas you can do the correlation?Areas of correlation are: 1) ItemData 2) TimeStamp 3) Links 4) Check Boxes 5) List Butoons 6) Radio Buttons 5.What is the function used for to find out the buffer size of file ? First of all we have to know the application type for this question. If it is web application we dont need to go for buffer size bcoz most of the functions are inbuilt with the buffer element. If we go for windows sockets application the function is mentioned below: char *lrs_get_static_buffer( char *s_desc, char *buffer, int offset, int length, char *encoding ); 6.What is the difference between Hits/secs & Throughput? Hits Per Second: This graph shows the number of HTTP requests made by Vusers to the Webserver during each second of the load test scenario run. Throughput:This graph shows the amount of throughput on the server during each second of the load test scenario run. Throughput is measured in bytes or megabytes and represents the amount of data that the Vusers received from the server at any given second. 7.How graph will be there between Hits/secs & Throughput?
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Hits per second is directly propositional to through put
If the Hits/secs Increses Throughput should also increase
if the Hits/sec decreases through put should also decrease
8.If suppose we are executing a scenario with 10 vusers and a value is parameterized (Say ex: Sales Id with 10values), how can i know that
what is the value of 5th vuser sales id?
The question is having little information to answer, Question should also have which parameter properties this scenario is using. Let us go with
some examples. If the setting is sales id picked Sequential and update for each iteration. in the first iteration all the users will use first value, so
the answer is 5th iteration. If it is Unique the 5th sales id will the 5th user will take. To find 5th vuser value we have to know first what we havegive the parameter properties.
If we take sequential-->each iteration then in parameter values 5th value is 5th vuser value and if we take unique also same value and if we
take random we have to check in the log file of LRR folder.
9.What is the purpose of the Unique value?
Assigns a unique sequential value to the parameter for each Vuser. Ensure that there is enough data in the table for all Vusers and their
iterations. Ifyou have 25 Vusers and you want to perform 4 iterations, your table must contain at least 100 unique values.
If you run out of unique values, VuGen behaves according to the option you select in the When run out of values field.
In real life applications, in lot of situations application will not accept duplicate values like order number, registration functionality.
10.In controller, when I am executing the scenario with 10vusers, among 10vusers 1 is failed then how you will find out who is the exact
user?
First of all enable the ip spoofing and insert "lr_get_vuser_ip()" then execute the scenario and take the log files saved in result directory(.LRR
extension) and find the failed user transaction then we can find vuser ip which is failed.
11.Is there any function in lr to avoid multiple login's if a user already logged in?
There is no function to avoid multiple logins. In case if we have to avoid multiple login based on our application then we have to write our own
code in "C" language.
12.In controller I am executing a scenario with 2Vusers and a value is paramerterized ( Say ex: Sales with 10values). So, whether it is possible
to assign for each users 5 values? If yes how ?
Go to parameter properties
Selext Next Row:Unique
Update each value on: Each occurence
then automatically radio button " Allocate ________ values for each vuser" will be enabeld
elow is the observation on Run time settings:
Think Time: Time delay between the user actions (Transactions)
Pacing: Time delay between the Iterations
Run Logic: number of iterations, This setting is applicable for both controller and Vugen.Eg: Vugen: 1 user, 1 iteration, 2 or 3 Iteration
In Controller : Running hourly based Test,
o Duration - 60 - Run logic iteration count will not be considered
o Run until completion - Run logic iterations will be considered
o Vugen : Vuser menu -> Run time settings - Run logic
o Controller : Select the script(group) - Right click - Open Run time settings
o Controller Run time settings will take priority over Vugen Run time settings
Log: Vugen: Extended log enable to debug the scripts.
In Controller : Disable log while running big load test or select Send messages only error occurs
Miscellaneous: Automatic Transactions:
o Define each Action as Transaction ( Default Action files: vuser_init, Action, Vuser_end) - Disable this option because we do not
response time for action blocks, we are more intrested each user action/transaction response time
o Define each step as a Transactions - Disable this also because it will provide each and every step(Get request or Post request) response
time, rather than measuring response time each and every indivdual steps response time, it is recomednded to keep manualtransaction points lr_start_transaction and lr_end_transaction
More information about run time settings:
Thread
1) If you run each Vuser as a thread, the Controller launches only one instance of the driver program (such as mdrv.exe), for every 50 Vusers (by
default). This driver process/program launches several Vusers, each Vuser running as a thread. These threaded Vusers share segments of the
memory of the parent driver process. This eliminates the need for multiple re-loading of the driver program/process saves much memory
space, thereby enabling more Vusers to be run on a single load generator.
The advantage of this mode is that it generates a script that has all known resources downloaded for your viewing. This works good
with non-HTML applications such as applets and non-browser applications (e.g. Win32 executables). But having everything together
creates another problem of overwhelming low-level information and making the script unintuitive.
When there are unrecognizable requests made to the server in Web (HTTP/HTML) protocol, they are recorded as
web_custom_request. However, in URL-mode, this can be selected to allow recording to default to web_custom_request.
GUI-mode
This is introduced with Web (Click & Script) protocol. The GUI-mode option instructs VuGen to record all editable fields in an object
or non-browser applications. What it does is to detect the fields that have been edited and generate the scripts accordingly. The
concept is similar to functional testing when objects are detected at the GUI-level. When reading the script, it allows easier reading
as the script is based on the GUI presented to the real user.
Different modes of recording in LoadRunner
Loadrunner Vugen Scripting
Let us discuss about below message functions in VuGen:
lr_output_message: Loadrunner output message functions sends output to replay log along with line number.
lr_log_message: Loadrunner log message functions sends output to replay log but it will not display any line number. lr_error_message: This is similar like output message but it will send error to output window and log file along with line number.
Correlation overview:
Correlation is the way handling dynamic values in client server communication.
The values captured will be send back to server in later steps in the script.
Correlation is typically used for handling session id's
Correlation Techniques:
Manual correlation
Automatic correlation.
Pictorial view of how correlation works:
Below is the snapshot of recording and replaying with out applying:
Below is the snapshot of recording and replaying after implementing correlation.
Steps for Manual correlation :
1. Record two identical scripts with the same business process
2. Compare the scripts to identify the dynamic value
3. Search for the dynamic values in the Generation log and Copy Left boundary (LB) and Right boundary (RB)4. Replay the script with extended log and look for those boundaries in replay log
5. Double click in the replay log where boundaries are found and it will take the cursor to the point where dynamic value is generating
in the recorded script.
6. Insert web_reg_save_param("Param name", "LB=" , "RB=", LAST) ; where the cursor is pointing
7. Replace the dynamic values with Param name
onitoring Unix performance from Loadrunner -controller
When you start scripting of web/http protocal, loadrunner automatically launches Internet
Explorer with the given URL in the recording options, if it does not launch IE ?
Here is the solution:
If it's a web based application, LoadRunner should launch its own IE window for recording. Itwon't record anything if this doesn't happen since it ignores all other windows. Try this to resolvethe issue:Open your Windows Control Panel >> System Properties >> Advanced tab.Click the
"Settings" button in the 'Performance' section and click the "Data Execution Prevention"
tab.Select 'Turn on DEP for all ... except those I select' and make sure that your browsersapplication is included in the list (in my case, Internet Explorer).Shut down Load Runner and
restart it, and good luck
This API set can be used for the following purposes:
Unattended creation of an Analysis session that can then be opened in the HP
LoadRunner Analysis. Custom extraction of data from the results of a test run under the HP LoadRunner
Controller
An application that creates an Analysis session can be run automatically at completion of a test
run. In the LoadRunner Controller, open Tools > Options and select the Execution tab. Enter thecommand to run your application in the Post Execution Command box.
The API set provides the following functionality:
Convert Controller Run results to an Analysis data base file
Create, modify, and apply a global filter and Graph filters
Set graph parameters
Calculate metrics and statistics per Graph in a Run
Notifications from the API infrastructure to the API application
Logging at different severity levels
Ability to run concurrent, independent instances of API-based applications
Limitations: This version of the API set does not support:
Graph auto-correlation
Graph merging
Importing data from external monitors
XML export of data
Support Level Agreements functionality
Use of filters, graphs, and other configurations created in the Analysis user interface
3. lr_think_time --> Pauses script execution to emulate think time — the time a real user pauses to
think between actions.
4. lr_continue_on_error --> Specifies an error handling method.
5. lr_rendezvous --> Sets a rendezvous point in a Vuser script. Not applicable for ApplicationManagement. ere, I’m going to describe some common recording problems / issues of Load
Runner and how to resolve them. Normally, these problems are faced by everyone. I would
request you all that leave your comments for the problems you face and how you tackle them.
1. Firefox is not supported: Only Internet Explorer is supported for Web (Click and
Script). To record browser activity on Firefox, use the Web (HTTP/HTML) protocol.2. Application behaves differently while being recorded: If your application behaves
differently during recording, than it does without recording, you should determine if the
recording problem is unique to Web (Click and Script). The effect may be that a Web
page will not load, part of the content is missing, a popup window does not open, and soforth. Create a new Web (HTTP/HTML) script and repeat the recording. In the event that
the recording is OK in Web (HTTP/HTML), we recommend that you disable socket levelrecording. The problem may be the result of an event listener. Use trial and error todisable event listeners in the Web Event Configuration Recording Options, and then re-
record your session as a Web (Click and Script) user. To disable an event listener:
o Open the Recording Options. Select Tools > Recording Options and select theGUI Properties:Web Event Configuration node.
o Click Custom Settings and expand the Web Objects node. Select an object.
o Select Disabled from the list in the Record column for the relevant Web object. If
the recording still does not work, enable the listener you previously disabled, andtry disabling another one. Repeat these steps until your recording succeeds.
3. Dynamic menu navigation was not recorded: A dynamic menu is a menu that
dynamically changes depending on where you select it. If the dynamic menu navigation
was not recorded, record again using "high" event configuration mode. To set theconfiguration level to high:
o Open the Recording Options. Select Tools > Recording Options and select the
GUI Properties:Web Event Configuration node.
o Move the slider to High.
4. Certain user actions were not recorded: Check if there is a Java applet running inside
the browser. If not, record the script with the Web (HTTP/HTML) protocol.