A 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.
Example - In 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.
TestCase folders
TestCases
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
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.
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.
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 Recovery, Tricentis Tosca re-executes the entire TestCase from scratch.
If you specify TestStepValue and a TestStepValue fails, Tricentis Tosca performs all TestStepValue Recovery Scenarios. After Recovery, Tricentis Tosca resumes execution at the TestStepValue in question and continues from there.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.