on failure action
Specify the action to be invoked in the event of a check failure from any check-type action.
Name | Description | Type | Modifier |
---|---|---|---|
action | Name of the action to be executed upon the occurrence of an error or warning. | String | None |
argument<index> | (Optional) Arguments to be passed to the action specified in the action argument. | String | None |
This action may be used within the following project items: test modules and user-defined actions.
Example - Case 1: Failure handler with no arguments
Action lines
In TestArchitect, create a user-defined action named "failure handler" with below sample script.
image location
capture screen D:\Images\failure_action.jpg
Input the user-defined action "failure handler" for the "action" argument of the "on failure action" action. In this way, the script will call the "failure handler" action when the execution gets a failure.
Initial
action
on failure action failure handler
 
config
 
start application
Test case: TC 01, Invalid login (Access denied)
username password
login john 54321
 
window message button
check message car rental message Invalid username or password ok
Result
Example - Case 2: Failure handler with arguments
Action lines
In TestArchitect, create a user-defined action named "failure handler" with below sample script.
name
argument arg1
argument arg2
 
text
report #arg1
report #arg2
Input the user-defined action "failure handler" for the "action" argument of the "on failure action" action. In this way, the script will call the "failure handler" action when the execution gets a failure.
Initial
action arg1 arg2
on failure action failure handler first argument's value second argument's value
 
config
 
start application
Test case: TC 01, Invalid login (Access denied)
username password
login john 54321
 
window message button
check message car rental message Invalid username or password ok
Result
- The number of optional arguments depends on the requirements of the action specified in action.
- This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.