Use recovery and cleanup scenarios

After you create your test cases, you can use recovery scenarios to handle errors. Create a recovery scenario to tell Tosca Cloud what to do if a test step fails. When your recovery scenario succeeds, Tosca Cloud resumes your test run.

If your recovery scenario fails, you can use a cleanup scenario to reset your system under test.

You can create recovery and cleanup scenarios in the Standard objects section of the test case editor.

Use recovery scenarios

Recovery scenarios let you automate how Tosca Cloud handles different error types. For example, a recovery scenario can log out and reenter user credentials. You can choose if it resumes from the test step value where the error occurred or from the test step or test case level.

There's no limit to how many recovery scenarios you can have in your test case. You can even add them to your test case folders. Tosca Cloud looks for the one closest to where the failure happened. If the closest recovery scenario fails, Tosca Cloud looks at the next highest level. When all of your recovery scenarios fail, Tosca Cloud runs your cleanup scenario and marks your test case as failed.

Add parameters and a property to tell Tosca Cloud what to do when your test case encounters an error. These parameters apply to your entire test case.

You can use the following parameters:

Parameter

Description

OnDialogFailure

Select what happens when the interaction between Tosca Cloud and your system under test fails.

Possible values:

  • Continue to go to the next test step and keep running from there.

  • Execute next TestCase to skip to the next test case.

  • Halt execution to stop the test run.

  • Recover to run your recovery scenario.

OnExceptionFailure

Select what happens when unforeseen events keep Tosca Cloud from running your test.

Possible values:

  • Continue to go to the next test step and keep running from there.

  • Execute next TestCase to skip to the next test case.

  • Halt execution to stop the test run.

  • Recover to run your recovery scenario.

OnVerificationFailure

Select what happens when a value provided by the system under test doesn't match the value you specified.

Possible values:

  • Continue to go to the next test step and keep running from there.

  • Execute next TestCase to skip to the next test case.

  • Halt execution to stop the test run.

  • Recover to run your recovery scenario.

TestCaseRetries

Enter the number of times you want to Tosca Cloud to retry your test case.

TestStepRetries

Enter the number of times you want to Tosca Cloud to retry your test step.

TestStepValueRetries

Enter the number of times you want to Tosca Cloud to retry your test step value.

 

When your test case runs and there's an error, Tosca Cloud runs your recovery scenario. If your recovery scenario succeeds, Tosca Cloud retries your test case on the level you want. You can choose if Tosca Cloud retries from the test case, test step, or test step value level.

To create a recovery scenario, follow these steps:

  1. Go to Standard objects > Recovery objects and select the + next to Recovery scenario.

  2. Add the objects and modules you need for your scenario.

  3. Add parameters based on your needs. For example, specify a kind of failure or number of retries.

  4. Go to Properties and choose your retry level.

Use cleanup scenarios

If your recovery scenario fails, you can use a cleanup scenario to reset your system under test. For example, a cleanup scenario can tell Tosca Cloud to log out and close the browser. You can define whatever steps you need to reset your test environment.

To create a cleanup scenario, follow these steps:

  1. Go to Standard objects > Recovery objects and select the + next to Cleanup scenario.

  2. Add the objects and modules you need to reset your test environment.

What's next

Check out other design elements that help you build better test cases, faster:

You're done building? Do a trial run of your test case so you can troubleshoot them before you add it to a playlist.