What is Failure Handling in Katalon?
Failure handling settings allow users to specify whether Katalon Studio should continue running in the event of an error during execution.
Katalon Studio currently supports the following failure-handling options:
Continue on Failure: Katalon Studio will continue regardless of any errors that occur during its execution. The step with errors will be marked as Failed.
Stop on Failure: If an error occurs, Katalon Studio will halt execution. The step with errors will be marked as Failed.
Optional: Katalon Studio will continue regardless of any errors that occur during its execution. The step with errors will be marked as a Warning.
Default handling of failures
- Follow these steps to define the default failure-handling behavior that will be used throughout your project:
From the Katalon Studio menu, access Project > Settings > Test Design > Test Case.
- Select the preferred option for the Failure Handling default behavior. When you’re finished, click OK.
Only new test steps will be affected by the option chosen. This change has no effect on the failure handling options for steps that already exist in your test cases. As a result, you may need to manually update them.
Override failure handling behavior
You can manually override the default failure handling behavior for each test step in either the Manual or Scripting views of the test case.
Manual View
- To open the context menu for the step where you want to change the failure handling behavior, right-click on it.
- Select the preferred failure handling option and save your test case.
In Scripting View
FailureHandling can be added as the final parameter to any built-in keyword in Katalon Studio. Use any of these options to specify the behavior of a keyword when editing it in Scripting mode.
FailureHandling.STOP_ON_FAILURE FailureHandling.CONTINUE_ON_FAILURE FailureHandling.OPTIONAL
Conclusion:
Using the above method, it gets very convenient to overcome failure handling in Katalon studio.