Professional Documents
Culture Documents
Krish Hegde 1
Developing Vuser Scripts
• The structure and content of a Vuser script
differ from one Vuser type to another.
• 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).
Krish Hegde 2
Developing Vuser Scripts
Krish Hegde 4
Recording Vuser Scripts
• When you record a Vuser script, VuGen
generates various functions that define the
actions that you perform during the recording
session. VuGen inserts these functions into the
VuGen editor to create a basic Vuser script.
• 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 the client and the server.
Krish Hegde 5
Recording Vuser Scripts
Krish Hegde 6
Recording Vuser Scripts
• When you record a Vuser script, VuGen
generates Vuser functions and inserts them into
the script. There are two types of Vuser
functions:
– General Vuser Functions:
The general Vuser functions are also called LR
functions because each LR function has an lr prefix.
– Protocol-Specific Vuser Functions:
The protocol-specific functions are particular to the type
of Vuser that you are recording. For example, VuGen
inserts LRD functions into a database script, LRT
functions into a TUXEDO script and LRS functions
into a Windows Socket script.
Krish Hegde 7
Transaction & Rendezvous
functions
• lr_start_transaction: Marks the
beginning of a transaction.
• lr_end_transaction: Marks the end of a
transaction.
• lr_rendezvous: Sets a rendezvous point.
Krish Hegde 8
Recording Vuser Scripts
• Each Vuser script that you create contains at
least three sections: vuser_init, one or more
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 login to a server into the
vuser_init section, client activity into the Actions
sections, and the logoff procedure into the
vuser_end section.
Krish Hegde 9
Recording Vuser Scripts
Krish Hegde 10
Recording Vuser Scripts
Krish Hegde 11
DB Vuser scripts
Krish Hegde 12
Recording Web Vuser
• Step 1: File > New> eBusiness (http/html)
• Step 2: Click on Record button
• Step 3: Enter URL and press OK
• Step 4: The web pages opens, start
browsing the web page and perform
actions
• Step 5: Stop recording
• Step 6: Run to debug the script.
Krish Hegde 13
Insert Transaction Points
• Step 7: Insert Transaction Start and
Transaction end points
• Step 8: Insert Rendezvous point
• Step 9: Run to debug script.
• Step 10: Insert Comments for reference.
Krish Hegde 14
Using C Functions
• VuGen generates Vuser scripts in C. All
standard ANSI C conventions apply to the
scripts, including control flow and syntax.
• You can add comments and conditional
statements to the script just as you do in other C
programs. You declare and define variables
using ANSI C conventions.
• There are many limitations for adding functions
in Vuser Script.
• Many C functions are not supported by Vuser
Script.
Krish Hegde 15
Using C Functions
• However, since the interpreter that is used
to run Vuser scripts does not support any
Microsoft extensions to ANSI C, you
cannot use Microsoft’s include files.
• It is better to use VuGen for recording
Vuser Scripts compared to manual coding
in C as there are many limitations in
adding functions.
Krish Hegde 16
• Questions?
Krish Hegde 17