Steps box
The Steps box tabs contains optional steps that you can drag and drop into your TruClient 2.0 - Web script.
Note: For details on the Run logic tab in the Steps box, see Run logic.
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. Select the object you want to verify.
|
Verify PDF content |
Verify the content of a PDF document when running the script.
|
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 |
Call a custom function in the script. Enter values for arguments which are set by the called function (for example, Arg1, Arg2). For details, see Work with 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.
Loop statements
Loops repeat selected portions of the script until certain criteria is met, or for a specified number of iterations:
Step | Description |
---|---|
For loop |
A logical structure that repeats the steps contained in the loop a specified number of times, until the end condition is met, or for a specified number of iterations, or until the code reaches a Break statement. Loop arguments use JavaScript syntax.
|
Continue |
Indicates that the current loop iteration should end immediately. The loop condition is then checked to see if the entire loop should end as well. If the loop continues, the script continues with the next iteration. For example, if a Continue statement is encountered in the second of five iterations in a loop, the second iteration will end immediately and the third iteration will begin. |
Break |
Causes the loop to end immediately, without completing the current or remaining iterations. For example, if a Break statement is encountered in the second of five iterations in loop, the loop will end immediately. |
If statements
To conditionalize a portion of the script, you can insert If type steps. These contain an If Block and an If Else block:
- 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 are run.
Step | Description |
---|---|
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. |
Exit step
An Exit step 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.
Catch error step
A Catch error step traps an error in the immediately preceding step, and runs the contents of the Catch error step. If the preceding step is a group step, Catch error traps errors from the entire group.
If you add 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.
The errors you can trap are:
- Any (default)
- Object Identification. The object the action is performed on cannot be found.
- Step Arguments. One or more of the arguments 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. The step timed out before reaching the End event.
To handle the error, enter or drag steps or functions into the Try and Catch blocks.
Steps box Miscellaneous tab
The Miscellaneous tab contains steps for inserting code, comments, and rendezvous points in your script.
Code steps
You can insert code into predefined steps as part of the step argument. In addition, you can use the following enhancement steps to add steps that are completely comprised of external code (C or JavaScript).
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. |
Evaluate C |
Receives a C function and runs it. You can define functions in the C-functions.c file.
Note: We recommend avoiding Evaluate C, and using JavaScript instead wherever possible. |
Additional steps
The Miscellaneous tab includes the following additional steps:
Step | Description |
---|---|
Comment | A blank step that enables you to insert comments in your script. |
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. Define the Rendezvous name, which is the specific point where Vusers are synchronized in the step. 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. |
See also: