Enhancing scripts for load testing overview

Developing a Vuser script includes the steps shown below.

This section describes optional tasks for preparing a Vuser script for load testing.

Add parameterization

When you record a business process, VuGen generates a script that contains the actual values used during recording. If you want to perform the script's actions using different values from those recorded, you replace the recorded values with parameters. This is known as parameterizing the script. For details, see Parameterization overview.

Back to top

Insert transactions

You can insert transactions into your Vuser script either while recording the script or after recording the script.

For inserting transactions during recording, use the buttons on the floating toolbar, or click Ctrl +T. For inserting transactions into your script after recording, use the Design > Insert in Script menu items.

For task details, see Insert transactions.

Back to top

Insert rendezvous points

You can instruct multiple Vusers to perform a task at exactly the same moment using a rendezvous point. When a Vuser arrives at the rendezvous point, it waits until all Vusers participating in the rendezvous arrive. When the designated number of Vusers arrive, the Vusers are released.

You can insert rendezvous points in one of the following ways:

  • To insert a rendezvous point while recording, click the Rendezvous button on the Recording toolbar and enter a name in the dialog box (not case sensitive).

  • To insert a rendezvous point after recording, select Design > Insert in Script > Rendezvous and enter a name for the rendezvous point (not case sensitive).

When a rendezvous point is inserted, VuGen inserts a lr_rendezvous function into the Vuser script. For example, the following function defines a rendezvous point named rendezvous1:

lr_rendezvous("rendezvous1");

For concept details, see Rendezvous points.

Back to top

Insert VuGen functions

You can insert VuGen functions at this point. For a list of some useful functions see VuGen functions.

Back to top

Insert steps

You can insert a variety of steps into your script such as think time steps, debug messages, and output messages. For task details, see Insert steps into a script.

Back to top

Insert comments

VuGen allows you to insert comments between Vuser activities. You can insert a comment to describe an activity or to provide information about a specific operation. For example, if you are recording database actions, you could insert a comment to mark the first query, such as "This is the first query."

You can insert a comment in one of the following ways:

  • To insert a comment while recording, click the Insert Comment button on the Recording toolbar and enter the desired comment in the Insert Comment dialog box.

  • To insert a comment after recording, select Design > Insert in Script > Comment and enter the comment.

The following script segment shows how a comment appears in a Vuser script:

/* <comments> */

Back to top

Insert log messages

You can use VuGen to generate and insert lr_log_message functions into a Vuser script. For example, if you are recording database actions, you could insert a message to indicate the first query, "This is the first query."

To insert a log message, select Design > Insert in Script > Log Message and enter the message.

Back to top

Insert synchronization points (RTE Vusers only)

You can add synchronization functions to synchronize the execution of the Vuser script with the output from your application. Synchronization applies to RTE Vuser scripts only.

The following is a list of the available synchronization functions:

Function
Description
TE_wait_cursor
Waits for the cursor to appear at a specified location in the terminal window.
TE_wait_silent
Waits for the client application to be silent for a specified number of seconds.
TE_wait_sync
Waits for the system to return from X-SYSTEM or Input Inhibited mode.
TE_wait_text
Waits for a string to appear in a designated location.
TE_wait_sync_transaction
Records the time that the system remained in the most recent X-SYSTEM mode.

For details about synchronization in RTE Vuser scripts, see RTE synchronization overview.

Back to top

See also: