Self-healing test cases

When you scan your application with Tosca XScan, Tosca Cloud automatically adds self-healing properties to your module. If something in your control changes and Tosca Cloud can't find it at runtime, it uses these properties to identify an alternate control and steers the alternate instead.

This stabilizes your tests and allows them continue, even if a control has changed.

Check self-healing properties

Tosca XScan automatically picks self-healing properties. To see which properties, go to Advanced View and select Self-Healing Properties from the ribbon menu.

You can also add or remove properties in this view, by selecting or deselecting the respective checkboxes.

Activate self-healing for a test case

To activate self-healing for a test case, add a parameter with the name Selfhealing and one of the following values:

  • Weighted assigns a weighting algorithm to all self-healing properties. The accumulated weight of all matching properties determines the most suitable alternate.

  • Combination creates all possible combinations of self-healing properties to find a suitable alternate.

Keep in mind that self-healing test cases may take longer. If Tosca Cloud encounters an issue with a control, it starts calculating weights or evaluating combinations. The complexity of your application code and the number of possible alternatives determine the length of that process.

Set limits for weighted algorithms

If you use Weighted, you can limit the amount of algorithm combinations to find a suitable alternate. By default, Tosca Cloud disregards all combinations that have a total weight smaller than 0.75.

To change this, create a parameter with the name SelfHealingWeightThreshold and your desired weight as the value.

Note that the decimal separator depends on your workstation's regional settings.

Deactivate self-healing

To deactivate self-healing for a test case, set the Selfhealing parameter to False or delete it altogether.