Share this page

# Enhance a script with Step box functions

There are a number of optional enhancements that can be added to scripts beyond the basic workflow. This task describes the enhancements and how to use them. For step details, see Steps box.

In this topic:

## Modify steps

Modify step arguments and objects by selecting the step and expanding the options. This expands the step and allows you to modify the objects and properties. For a detailed list of the step structure, see Steps box.

- Insert Flow Control Steps

  Loops repeat selected portions of the script until certain criteria is met or for a specified number of times. To insert a loop, click the Add Step button , select Flow Control and drag For loop to the relevant location in the script. For details, see Insert and modify loops.

- Insert If blocks or If-else blocks and exit steps

  To conditionalize a portion of the script, you can insert If or If-else blocks. To insert an If block, click Step, select Flow Control and drag If block to the relevant location in the script. To add an else condition, click the Add else link next to the If step title. For more details, see TruClient step arguments.

  Exit steps cause a script to exit the iteration or the entire script. These can be used with If statements to exit a script or iteration when a specified condition occurs. To insert an exit step, click the Add Step button , select Flow Control and drag Exit to the relevant location in the script.

Back to top

## Insert comments

You can insert comments into your script by clicking the Add Step button , selecting Miscellaneous and dragging the Comment step to the relevant location in the script.

Back to top

## Catch error step

A Catch error step traps an error in the immediately preceding step. If the preceding step is a group step, Catch error traps errors from the entire group.

If there is more than one Catch error step one after the other, they all apply to the step preceding the first Catch error step in the sequence.

To insert a Catch error step, click the Add Step button , select Flow Control and drag the Catch Error step to the relevant location in the script.

The errors you can trap are:

- Any.
- Object identification. The object the action is performed on cannot be found.
- Step arguments. One or more of the arguments to the preceding step is invalid. For example, the data type is wrong.
- Step Action. The user action failed. For example, a navigation step did not find the page. For an action on a UI element, this error is triggered if the object was found and the action failed anyway.

To handle the error, enter or drag steps or functions into the group action box. Click the +/- icon to show the box.

For example:

Back to top

## Verify that an object exists

To verify that a string or object exists in the application, you can insert a verify step:

1. Click the Add Step button , select Functions and drag the Verify step to the relevant location in the script.

2. Click the object in the verify step.

3. Select the object you want to verify.

Back to top

## Insert generic steps

You can insert a generic or blank step and manually configure it. To insert a generic step do the following:

1. Click the Add Step button , select Functions and drag the Generic Object/Browser Action step to the relevant location in the script.Drag and drop the step to the relevant location.

2. Expand the step, and enter the step properties.

   Generic Object Actions perform an unspecified action on an object. Generic Browser Actions perform an unspecified action on the browser such as back, reload, and switch tabs.

Back to top

## Add download filters

You can add URLs to VuGen > Runtime Settings > Download Filters to either include or exclude specific URLs while replaying your script.

Back to top

## Select multiple files for upload

TruClient enables you to record and replay the selection of multiple files for upload.

You can create a step with multiple files selected for upload in two ways:

- Record the operation on a filebox object (see TruClient step arguments). After recording, the path argument of the generated step contains only the file names of the selected files. You must manually change each file name to the full file path.

- Create a Generic Object Action step (see Steps box), choose a filebox object, and set the paths in the Arguments field.

The step shows all of the selected files in the Arguments section under the Path property, with the file names separated by a semicolon ";":

Back to top

See also:

- TruClient functions
- TruClient step arguments
- TruClient step structure

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 25.1-25.3 All View Local Help Center View Online Help Center Version: