background image
<< Why Use Timers | Why Use Blocks >>
<< Why Use Timers | Why Use Blocks >>
VU Language Reference
Adding Features to Scripts
8-4
The following are the timer commands for VU scripts:
þ
start_time
­ Starts timing the activity. Insert this command immediately
before the first emulation command for the activity that you are timing. The
start_time
measurement includes the think time (if any) for the next
emulation command in the script.
To exclude the think time for an emulation command, insert
start_time
after the emulation command and use the
_fs_ts
read-only variable. For
example:
http_request ["test1.001"] ...
start_time ["timerid"] _fs_ts;
stop_time ["timerid"];
þ
stop_time
­ Stops timing the activity. Insert this command immediately after
the last emulation command for the activity that you are timing.
For information on using timers in VU scripts, see the
start_time
command in
the VU Language Reference.
For information on using timers in Visual Basic scripts, see the
TimerStart
method in Rational Test Script Services for Visual Basic.
For information on using timers in SQABasic scripts, see the
StartTimer
command in SQABasic Language Reference.
Blocks
A block is a set of contiguous lines of code that you want to make distinct from the
rest of the script. Typically, you use a block to identify a transaction within a script.
A block has the following characteristics:
þ
A block begins with the comment. In the VU language, a block begins like this:
/* Start_Block "BlockName" */
þ
Robot automatically starts a timer at the start of the block. In the VU language,
the timer looks like this:
start_time ["BlockName"] _fs_ts;
Typically, the
start_time
emulation command is inserted after the first
action, but with an argument to use a read-only variable that refers to the start
of the first action.
þ
The ID of every emulation command in a block is constructed the same way--
that is, by the block name followed by a unique, three-digit autonumber.
For example, in the VU language: