Enhancement steps
This topic explains how to enhance your TruClient script by adding steps from the Steps box.
For details on the Steps box Run logic tab, see Run logic.
About using optional steps
There are a number of optional steps that can be added to scripts beyond the basic recorded workflow. These steps are designed to enhance the performance and flow of your script, so that it can more accurately represent your business process.
You add the steps by dragging and dropping them from the Steps box, and then edit the steps as required. This provides UI-based script development, without need for extensive coding skills.
To add a step to a script:
-
Click the Add step button in the Development window Toolbar to open and close the Steps box.
-
Select a step in one of the Steps box tabs and drag it to the required location in the script.
Steps box Functions tab
The Functions tab includes the following function steps:
Step | Description |
---|---|
Verify | Verify that an object or string exists in the application. |
Verify PDF content |
Verify the content of a PDF document during script execution. For details, see Verify PDF Content. |
Wait | Wait for a specified number of seconds (or milliseconds), before continuing with the next step. |
Generic object action |
A blank step that can be inserted and manually configured, to perform an unspecified action on an object. |
Generic browser action |
A blank step that can be inserted and manually configured, to perform an unspecified action on the browser such as back, reload, and switch tabs. |
Take snapshot | Take a snapshot at that point during replay. |
Call function | Insert a custom function in the script. For details, see TruClient functions and function libraries. |
Wait for object | Wait for an object to load before continuing with the next step. |
Steps box Flow control tab
The Flow control tab contains steps that enable you to build the logic of your script.
To conditionalize a portion of the script, you can insert If type steps. These contain an If Block and an If Else block. You can populate these blocks with existing steps using drag or copy-paste, or record steps for them using the Record into selected step option.
- If Block. If the condition is met, run the specified steps.
-
Else Block. If the condition in the If Block is not met, the steps included in the Else Block section run.
Step | Description |
---|---|
For loop |
A logical structure that repeats the steps contained in the loop until certain criteria is met, or for a specified number of times. For details, see Insert and modify loops. |
If block | A logical structure that runs the steps contained in the step If Block, as long as a defined condition expression is met. You can define any condition, as long as the result is a boolean value. |
If verify | A combination of If block and Verify steps. A logical structure that runs the steps contained in the block, if the condition on a property of the selected object is met. |
If exists | A logical structure that runs the steps contained in the block, if the selected object exists in the application. |
If not exists | A logical structure that runs the steps contained in the block, if the selected object does not exist in the application. |
Continue | Causes the current loop iteration to end immediately. The script continues with the next iteration. |
Break | Causes the loop to end immediately without completing the current or remaining iterations. |
Catch error | Catches an error in the step immediately preceding and runs the contents of the catch error step. For more information, see Catch error step. |
Exit |
Exits the iteration or the entire script, depending on the specified setting. This step can be used together with If statements, to exit a script or iteration when the specified condition occurs. |
Steps box Miscellaneous tab
The Miscellaneous tab includes the following steps:
Step | Description |
---|---|
Evaluate JavaScript |
Runs the JavaScript code contained in the step. |
Evaluate JavaScript on object | Runs the JavaScript code contained in the step after the specified object is loaded in the application. |
Comment | A blank step that enables you to insert comments in your script. |
Evaluate C | Receives a C function name and runs it. You can define functions in the C-functions.c file.
|
Rendezvous |
Synchronize all Vusers in a Controller scenario to run a specified step at the same time. For example, you may want to test the impact of several users logging into your application at the same time. Note: To insert a rendezvous step, drag it from the Steps box and place it above the step you want to synchronize. |
Steps box Transactions tab
The steps on the Transactions tab enable you to control transactions:
For details, see Insert transactions in scripts.
Step | Description |
---|---|
Start transaction |
Starts a new transaction at the insertion point. |
End transaction | Ends the named transaction at the insertion point. |
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, select the Flow control tab in the Steps box, 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.
- Step Timeout
To handle the error, enter or drag steps or functions into the Try and Catch blocks.
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. 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, 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 ";":
See also: