UiPath Studio supports structured exception handling through the Try Catch activity, allowing automated test workflows to respond to unexpected execution failures while preserving diagnostic evidence.
Option A correctly combines exception handling, explicit verification failure, and screenshot capture.
The Try block contains the primary test execution activities. When an exception occurs, control passes to the corresponding Catch block, where the developer can implement diagnostic logging and verification logic.
The Verify Expression activity evaluates a Boolean condition and determines whether the expected verification has succeeded.
Setting Expression to False forces the verification to fail. Configuring TakeScreenshotIfFailed as True instructs the activity to capture a screenshot when that verification fails.
This enables the test execution result to contain evidence of the application state associated with the failure, provided screenshot capture is supported and the application context is available.
Option B produces a failed verification but does not explicitly enable screenshot capture. Option C evaluates a successful expression and therefore does not trigger failure-based screenshot capture.
Option D places the verification in the Finally block, which executes regardless of whether the original test case throws an exception. Consequently, it could incorrectly fail otherwise successful executions.
For reliable reporting, the Catch block should also preserve the original exception details and avoid suppressing unexpected failures.
Official UiPath Reference(s): Testing Activities — Verify Expression; TakeScreenshotIfFailed; ContinueOnFailure; Test Cloud — Application testing best practices.
Submit