Enhancing a Script 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. Suppose you want to perform the script's actions (query, submit, and so forth) using different values from those recorded. To do this, 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:


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 Adding VuGen Functions Overview.

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:

Waits for the cursor to appear at a specified location in the terminal window.
Waits for the client application to be silent for a specified number of seconds.
Waits for the system to return from X-SYSTEM or Input Inhibited mode.
Waits for a string to appear in a designated location.
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: