Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Friday 9 June 2023

Recovery Scenario

Recovery Scenario is a collection of TestSteps that Tricentis Tosca executes if particular tests fail.

Goal - The goal of Recovery is to fix failing test step values or test steps by employing “corrective” test steps.

ExampleIn the application, if search keyword is not provided as part of input data and when search button is clicked. A chrome alert pop-up appears with the message “Please enter some search keyword". 

Instead of using an “If statement” in the test case to handle the chrome alert pop up. A recover scenario can be created. The moment actual test case fails due to the pop up the recover scenario will be automatically triggered and once the recovery scenario returns a positive result status. The execution would continue with the test case. If the pop up does not appear and the test case doesn’t fail the recovery scenario will not be triggered.

Note: – Recovery scenario will apply only if the execution of the test case is done from the execution folder section. It will not apply if the test case is run in the scratch book.

Retry levels for the recovery scenario -- 

It is also important to specify the retry levels for the recovery scenario. Tosca supports the following three retry levels.

  • Retry Level – Test case - The recovery scenario will jump in to handle the pop up and returns the positive result. The retry of the test case will be from its first test step “OpenUrl” as the retry level value test case is selected.
  • Retry Level – Test step  The recovery scenario will jump in to handle the pop up and returns the positive result. The retry will be from the failed test step "SearchButton". Note: It will not re-trigger from the "'OpenUrl" as the retry level selected is test step.
  • Retry Level – Test step value - If the retry level is set to test step value. In this case, if the test step value “Booksearch” fails due to the Chrome alert pop up.  The recovery scenario will handle the pop up and the retry will continue from the failed test step value “Booksearch".

Prerequisite - The following settings must be updated.

  • In project -> settings -> TBox-> Recover

We can create Recovery Scenarios for one of the following objects:
  • TestCase folders

  • TestCases

Creating Recovery Scenarios
---------------------------------------
  1. Right-click the object and select Create Recovery Scenario Collection from the mini toolbar.

    The Recovery Scenario Collection applies to the following levels:

    • the object for which you have created it

    • all sub-items therein



  1. Right-click the newly created folder *** Recovery Scenarios *** and select  Create Recovery Scenario from the mini toolbar. You can create several Recovery Scenarios in one folder.

  2. Determine what Tricentis Tosca should do if tests fail. To do so, add TestSteps to your Recovery Scenario. You can either use existing TestSteps, or you can create them via Fuzzy Search.

Fuzzy Search. -  Tosca Fuzzy Search lets you search for Modules, XModules, and Reusable TestStepBlocks to create new TestSteps.

To launch the Fuzzy Search, right-click an object and select Search and Add TestStep from the context menu, or select the object and press Ctrl + T.

The Fuzzy Search searches all Module, XModule, and Reusable TestStepBlock names for the search term and for parts of it. Characters that match the search term are highlighted. The order of the search results depends on how many search term characters match the entry.

4. For instance, the TestStep Home - Select "Automobile" steers a control on a website. A possible Recovery Scenario could be to close and reopen the browser tab.


  1. Specify when Tricentis Tosca should apply the scenario. Enter one of the following values for the Recovery Scenario property RetryLevel:

    • TestStepValue: apply this Recovery Scenario if a TestStepValue fails

    • TestStep: apply this Recovery Scenario if a TestStep fails

    • TestCase: apply this Recovery Scenario if the TestCase fails

    The RetryLevel property also defines the point from which Tricentis Tosca resumes execution after Recovery.

    For instance, if you specify the value TestCase and a TestStepValue fails, Tricentis Tosca performs all TestCase Recovery Scenarios. After RecoveryTricentis Tosca re-executes the entire TestCase from scratch.

    If you specify TestStepValue and a TestStepValue fails, Tricentis Tosca performs all TestStepValue Recovery Scenarios. After RecoveryTricentis Tosca resumes execution at the TestStepValue in question and continues from there.


NOTE -- If you created your TestStep from an XModule whose property InterfaceType is NonGUI, you can only recover on the TestCase level.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.