Enhance a script with Toolbox 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 Toolbox.
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 TruClient Toolbox.
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, select Toolbox > Flow Control > For loop. For details, see How to Insert and Modify Loops.
For a video demonstration of a use-case scenario involving loops and alternative steps, TruClient Loops and Alternative Steps Video.
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, select Toolbox > Flow Control > If block. 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, select Toolbox > Flow Control > Exit.
You can insert comments into your script by selecting Toolbox > Misc and dragging the Comment icon to the desired location.
Catch error steps are group steps that run their contents if the previous step contains an error. Additionally, the error is "caught" and is not returned. You can define catch error steps to catch any error, or a specific type of error. If there are two catch error steps in a row, they both apply to the same step. To insert a catch error step, select Toolbox > Flow Control > Catch Error.
To verify that a string or object exists in the application, you can insert a verify step:
Select Toolbox > Functions and drag the Verify icon to the desired location.
Click the object in the verify step.
Select the object you want to verify.
You can insert a generic or blank step and manually configure it. To insert a generic step do the following:
- Select Toolbox > Functions > Generic Object/Browser Action.
- 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.
You can add URLs to Runtime Settings >Download Filters to either include or exclude specific URLs while replaying your script.