Professional Documents
Culture Documents
‘Recording Options’ is one of the important concepts in script recording. It allows various options
for selection on how the script is to be recorded.
(i) HTML based: HTML based recording is also called as context-sensitive (or context based)
recording. In this mode of recording, each user action is recorded as a separate request. For
Example, when a user performs an action (example login), one ‘login request’ is created.
In the Example below, we have the Vugen script recorded in the HTML mode for invoking the url
and logging into the ‘Web tours’ application.
Here there are two user actions – Invoke url and Login. Thus two requests are recorded, one for
each of these user actions.
"URL=http://127.0.0.1:1080/WebTours/index.htm",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=../favicon.ico", "Referer=", ENDITEM,
"Url=https://www.bing.com/favicon.ico", "Referer=", ENDITEM,
LAST);
// Request2 – Login
web_submit_form("login.pl",
"Snapshot=t2.inf",
ITEMDATA,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=login.x", "Value=47", ENDITEM,
"Name=login.y", "Value=10", ENDITEM,
LAST);
Also, if we see, the first request shows the url but the second doesn’t. Which means the second
request (Login) is dependent on the response of the previous request (invoke url) and hence this
mode of recording is called the ‘Context-sensitive’ recording.
The advantage of HTML based recording is that the scripts are smaller and simple and do not
require much customization/enhancements (correlation etc.).
The flipside is that the maintenance of the scripts may become difficult – the requests being
context sensitive, any UI change would impact the script and may lead to errors on replay.
Here again, there are two user actions – Invoke url and Login, But there are more than two
requests as the images and icons associated with the ‘Invoke url’ action are recorded as separate
requests.
"URL=http://127.0.0.1:1080/WebTours/index.htm",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTTP",
LAST);
web_concurrent_start(NULL);
// Request1a - image
web_url("hp_logo.png",
"URL=http://127.0.0.1:1080/WebTours/images/hp_logo.png",
"Resource=1",
"RecContentType=image/png",
"Referer=http://127.0.0.1:1080/WebTours/header.html",
"Snapshot=t3.inf",
LAST);
// Request1b - image
web_url("webtours.png",
"URL=http://127.0.0.1:1080/WebTours/images/webtours.png",
"Resource=1",
"RecContentType=image/png",
"Referer=http://127.0.0.1:1080/WebTours/header.html",
"Snapshot=t4.inf",
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
// Request1c - icon
web_url("favicon.ico",
"URL=http://127.0.0.1:1080/favicon.ico",
"Resource=1",
"Referer=",
"Snapshot=t9.inf",
LAST);
// Request1d - icon
web_url("favicon.ico_2",
"URL=https://www.bing.com/favicon.ico",
"Resource=1",
"RecContentType=image/x-icon",
"Referer=",
"Snapshot=t10.inf",
LAST);
web_concurrent_end(NULL);
// Request2 – Login
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/cgi-bin/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/cgi-bin/nav.pl?in=home",
"Snapshot=t12.inf",
"Mode=HTTP",
ITEMDATA,
"Name=userSession", "Value=123203.335763467zDDHcHVpfiDDDDDDDiAc", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=47", ENDITEM,
"Name=login.y", "Value=10", ENDITEM,
LAST);
If we see, all the requests have their respective URLs. Which means the requests are not
dependent on the response of the previous request, hence this mode of recording is called
‘Context-less’ recording.
Scripts generated in the URL based recording are large and complex, hence they require more
customization/enhancements (correlation etc.).
However, the maintenance of the scripts is easy, as the requests are being contextless, any UI
change would not impact the script.
In the HTML mode, there is a second option ‘A script containing explicit URLs only’ which
combines the advantages of both (HTML and URL modes of recording) – the script remains small
and simple, hence the maintenance of the scripts becomes easy. This mode of recording is mostly
recommended for Web Applications.
#2) General-Script
We generally do not change any of these options, but it is worth understanding at least some of
them.
Language: This drop-down allows us to select the language to use when working with the script.
The allowed language(s) is dependent on the protocol used. For Web-http/HTML protocol, ‘C
Language’ and ‘JavaScript’ languages are supported. And we shall select ‘C Language’ here.
Property – Generate think time greater than the threshold: This option directs VuGen to insert
think time (wait time between user actions) only if the user waits for a value more than the
threshold (3 sec here) mentioned.
Other properties are self-explanatory.
#3) General-Protocols
This option shows the protocol(s) that was/were selected to record the script. We can select-
deselect accordingly.
This page offers various options to help customize the code generation and replay.
In the WinINet level recording, the WinINet API developed by Microsoft (for Windows) is used to
interact with (and record the requests/traffic) the various application-level protocols at a specified
port (port mapping is not relevant here).
If we select WinINet level, LoadRunner records traffic that is generated by the application which
uses the WinINet API to communicate to the servers. If we select Socket level, Vugen captures the
traffic on the socket-level at a specified port.
It is not an easy answer to say which one of these to select when recording the script. It is better to
use trial and error method – if the script is not recorded, switch between these options until we
succeed.
As explained above, for socket-level capture, Port mapping is relevant and is used to map the
traffic from a specified server-port combination to the desired communication protocol (traffic
filtering is used to exclude the traffic from a specified server-port).
Also, the ‘Options’ button takes us the Advanced Port Mapping settings which allow us to select
the SSL versions etc. but most of the times we do not worry about these options.
So far, we discussed the recording options that are relevant for script recording. We will cover the
other recording options in our subsequent tutorials.
UPDATE:
Below are the hands-on video tutorials recorded on the Micro Focus LoadRunner version but still
very relevant and useful on Micro Focus LoadRunner version as well.
VIDEO 1 – VuGen Recording Options Part I
This video tutorial will give an overview of VUGen Script and Protocol Recording Options in detail.
Video 1 Summary:
This tutorial covers the VuGen Recording Options. Apart from this, it also covers:
Script Section
New Virtual User dialog
Start Recording dialog
In Script Section, we discussed three sections of the script (vuser_init, Action, vuser_end) and
running sequence.
On New Virtual User Dialog, we try to touch base with all the fields and their importance so that
while selecting the protocol for scripting, user should know its significance. This is the first step for
script creation. VuGen provides option to create Single Protocol and Multiple Protocol script.
On Start Recording Dialog, we discussed the fields with their valid input data. This is second step
for script creation. From this dialog type of application, browser, URL, working directory, and
“Record into Action” options are selected.
1. Scripts
2. Protocol
3. Recording
4. Port Mapping
5. Advanced Settings
6. Correlation
7. Code Generation
Script – This provides option to select the scripting language along with few settings related to the
script. For Web (HTTP/HTML) protocol, the scripting language is C.
Protocol – This displays the protocol that we selected on New Virtual User Dialog box.
In the part-1, we have seen script sections and different dialog. For Recording options, we have
seen how to select scripting language and confirm the protocol that is going to be used while
scripting.
Recording – Selection of mode or http/html level can be done from this. We discussed in
detail URL and HTMl mode of web (HTTP/HTML) protocol, which gives good understanding
and idea about the major difference between them.
Port Mapping– This provides option for Port Mapping.
Advanced Settings– This covers few advanced settings related to script generation or
script execution. We discussed each option available in detail.
Correlation– This is related to Automated Correlation. Correlation rules are created and
enabled from this. In short, we discussed the fields available for the users on this dialog.
Code Generation– This enhance the data format capabilities of web protocol.
The part I and II tutorials explain all important fields on different dialog boxes related to recording
options and protocol selection which user should know before using LoadRunner. This will make
you ready for recording a script with all the required information for VuGen configuration.
Conclusion
In this tutorial, we discussed the ‘Recording options’ (options that are relevant for recording the
script).
We shall discuss ‘Recording options part 2’ when we discuss ‘Correlation’ in our upcoming
tutorial of the series.
=> Visit Here For Complete Series of LoadRunner Tutorials
PREV Tutorial | NEXT Tutorial
Recommended Reading
Introduction to VuGen (Virtual User Generator) Script with Recording Example
VuGen Script Recording, Replay and Dynamic Values with Correlation
How to Setup LoadRunner VuGen Script Files and Runtime Settings
Web Services Performance Testing Using LoadRunner VuGen Scripting
Load Testing with HP LoadRunner Tutorials
Important LoadRunner Functions Used in VuGen Scripts with Examples
LoadRunner VuGen Scripting Challenges
Introduction to Micro Focus LoadRunner - Load Testing with LoadRunner Tutorial #1