Introduction
Software testing is no longer just about finding bugs. It’s about ensuring continuity, stability, and precision throughout the development cycle. A well-configured testing environment must not only detect failures but also handle them intelligently. That’s where the TOSCA Recovery Scenario comes in.
A TOSCA Recovery Scenario is a powerful feature in Tricentis Tosca designed to automatically handle errors and recover from test failures. This article explores how to effectively implement recovery scenarios, configure them at both global and test case levels, and use them smartly for smarter error handling. If you’re enrolled in TOSCA Training Online or planning to, this guide is essential for mastering test recovery.
What Is a TOSCA Recovery Scenario?
A TOSCA Recovery Scenario is a predefined set of TestSteps that Tricentis Tosca executes when a particular test fails. These recovery TestSteps help resume test execution after handling the issue. Rather than stopping execution at the point of failure, Tosca tries to recover, retry, and move on. This feature drastically improves test automation reliability.
For example, if a login fails due to a pop-up error, the recovery scenario can handle the dialog, close it, and retry the login.
Why You Should Learn TOSCA Recovery Scenario
Implementing recovery mechanisms not only makes automation more stable but also reduces manual intervention. With test automation growing in scale, building resilience into your scripts is critical. A deep understanding of TOSCA Recovery Scenario gives QA professionals an edge in managing test failures gracefully and efficiently.
Enabling Recovery Scenarios in Tosca
Apply to the Entire Workspace
To enable TOSCA Recovery Scenario globally across your Tosca workspace, follow these steps:
- Open Tosca Commander.
- Navigate to Settings > TBox > Recovery.
- Set the following parameters:
- OnDialogFailure = Recover
- OnExceptionFailure = Recover
- OnVerificationFailure = Recover
- TestStepValueRetries = 2
- TestStepRetries = 2
- TestCaseRetries = 1
These settings will apply recovery handling to all test objects in the workspace, meaning any failure can trigger a recovery attempt.
This global configuration ensures that TOSCA Recovery Scenario is active for every test execution unless specifically overridden.
Apply to Specific Test Case or Folder
Tosca allows more granular control through configuration parameters at test folder or test case level. This is particularly useful for cases where recovery logic differs based on the type of test.
Steps:
- Right-click on the test case or folder.
- Go to Test Configuration.
- Add the recovery configuration:
- OnDialogFailure = Recover
- OnExceptionFailure = Recover
- OnVerificationFailure = Recover
- TestStepValueRetries = 2
- TestStepRetries = 1
- TestCaseRetries = 1
This method allows you to apply TOSCA Recovery Scenario selectively, making your error handling more context-aware and efficient.
Retry Levels in TOSCA Recovery Scenario
A critical part of recovery scenarios is setting the Retry Level, which defines at what point Tosca should attempt a retry:
1. TestStepValue
Retry is triggered if a specific value within a TestStep fails. Ideal for validations and input field errors.
2. TestStep
Retry is triggered when the entire TestStep fails. This includes actions like button clicks, navigation, etc.
3. TestCase
Retry is triggered only if the entire test case fails. It is broader in scope and used when the test flow must be rerun.
To configure the RetryLevel, navigate to the recovery scenario TestStep and modify the property in the Properties panel. This ensures Tosca knows the exact condition to initiate a TOSCA Recovery Scenario.
Execution from the Execution Tab Only
Important: Recovery Scenarios only execute when tests are run from the Execution Tab.
- Drag and drop your test cases or test folders into the Execution List under the Execution Tab.
- Start execution from there.
Running from ScratchBook will not trigger any TOSCA Recovery Scenario, which could result in incomplete or failed test runs without recovery.
This restriction ensures that recovery mechanisms are used only in structured, monitored executions.
Default Behavior After Recovery
When a step fails and the TOSCA Recovery Scenario is triggered:
- Tosca executes the recovery TestSteps.
- Once recovery is complete, Tosca will retry the failed step by default.
This makes error handling seamless and intelligent. Instead of just logging the failure, Tosca tries to self-heal and proceed.
This built-in retry-after-recovery behavior is one of the most powerful features of TOSCA Recovery Scenario.
Visual Configuration Walkthrough
Below is a practical example based on standard Tosca UI structure:
Workspace Settings View:
This configuration ensures your entire test suite is equipped with error handling and self-recovery mechanisms.
Recovery Scenario Structure Example
Here’s an example structure in the TestCases module:
- Login On Main Menu
- Click on Login from Main Menu
- Recovery Scenarios
- Recovery Click on Login
- Logout_Reference
- Demo Web Shop Logout
- Recovery Click on Login
- Click on Login_Reference
- Login
- Recovery Scenarios
- Click on Login from Main Menu
And in the properties pane of Recovery Click on Login, you’ll set RetryLevel = TestCase.
This setup means Tosca will retry the test case if login fails, but not for minor UI or value-related issues.
Best Practices for Using TOSCA Recovery Scenario
According to the Tricentis best practices, here are recommended guidelines:
1. Use Recovery Scenarios Sparingly
Only apply recovery steps where necessary. Overusing them can clutter test cases and reduce execution speed.
2. Keep Recovery Steps Independent
Ensure recovery TestSteps do not rely on prior steps. They should operate independently to handle the failure condition.
3. Validate Recovery Success
Use checkpoints in your recovery TestSteps to confirm that recovery actions succeeded.
4. Log and Notify
Log every recovery attempt and failure. Notifications can be sent for critical failures even after recovery.
5. Test Recovery Scenarios Separately
Before applying them in actual test flows, validate each recovery scenario using isolated test cases.
Following these practices improves the robustness of your TOSCA Recovery Scenario implementation.
Benefits of TOSCA Recovery Scenario in Real Projects
- Increased Test Stability: Automated retries prevent tests from failing due to transient issues.
- Reduced Manual Intervention: Less tester involvement during execution.
- Improved Reporting: Clear distinction between failed, recovered, and retried steps.
- Higher Test Coverage: Allows deeper automation without fear of instability.
Whether you’re pursuing a TOSCA Automation Course Online or practicing independently, mastering recovery scenarios enhances your automation maturity.
TOSCA Certification Insight
Understanding and implementing TOSCA Recovery Scenario is crucial for certification. If you’re aiming for Tosca certification, expect scenario-based questions on configuration, retry levels, and execution conditions.
Knowing how to:
- Apply global vs local configurations
- Set retry levels appropriately
- Use Execution Tab for triggering recovery
…will significantly improve your score and real-world readiness. Knowing these also justifies the TOSCA Certification Cost by maximizing your return on investment.
Summary and Key Takeaways
- A TOSCA Recovery Scenario is a set of steps executed when a test fails.
- It can be configured globally (workspace level) or locally (test case/folder).
- Set RetryLevel to TestStepValue, TestStep, or TestCase based on need.
- Only run from Execution Tab to trigger recovery.
- Tosca retries failed steps automatically after recovery.
- Use best practices for optimal stability and performance.
Final Thoughts
The TOSCA Recovery Scenario is more than a fallback; it’s a strategic feature that brings resilience and intelligence to your automated testing. Mastering it is not optional it’s essential.
Start exploring TOSCA Recovery Scenario today to enhance your test automation skills. Apply these strategies in your next project to build more resilient and reliable test suites.