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.
Modify step arguments and objects by selecting the desired 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 Step, select Flow Control and drag For loop to the desired 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 desired 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 Step, select Flow Control and drag Exit to the desired location in the script.
You can insert comments into your script by clicking Step, selecting Miscellaneous and dragging the Comment step to the desired location in the script.
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 Step, select Flow Control and drag the Catch Error step to the desired location in the script.
The errors you can trap are:
- 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.
Verify that an object exists
To verify that a string or object exists in the application, you can insert a verify step:
Click Step, select Functions and drag the Verify step to the desired location in the script.
Click the object in the verify step.
Select the object you want to verify.
Insert generic steps
You can insert a generic or blank step and manually configure it. To insert a generic step do the following:
- Click Step, select Functions and drag the Generic Object/Browser Action step to the desired location in the script.
- Drag and drop the step to the desired location.
Expand the step, and enter the desired 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.
Add download filters
You can add URLs to VuGen > Runtime Settings > Download Filters to either include or exclude specific URLs while replaying your script.
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 ";":