Skip to content
Get Free Trial

Autoheal

Autoheal allows automatic healing and recovery of failing scripts based on the data from previous runs.

Autoheal is the ability of the automation script to heal itself when it encounters a failure. When an element is not found by Sahi, it will try to look for a viable alternate based on the data of its previous runs. If the alternative works fine, Sahi will mark the change in the logs and continue execution. This can reduce failures and reduce effort spent in stopping, analyzing and rerunning scripts.

Autoheal is currently available only for web automation.

Autoheal is disabled by default.

  • To enable Autoheal globally, set sahi.autoheal.enabled=true in userdata/config/userdata.properties

  • To enable at suite execution level,

    • In the Run Configuration, open Advanced Settings and turn on Enable Autoheal.
    • From ANT target, add <property name="isAutohealEnabled" value="true"/>Suite level setting overrides global setting.
  • sahi.autoheal.disabled_apis: userdata property is provided to disable autoheal for functions for which autoheal is not desired.

    Default value is _assertVisible,_assertNotVisible,_assertExists,_assertNotExists,_assertNotNull,_assertNull,_exists,_isVisible.

  • sahi.autoheal.autoheal_probability_percentage: userdata property is provided to set autoheal probability. Increase value when scripts are not able to pick an alternative element. Decrease value when Autoheal is causing false positives. Default value is 50. Highly experimental: better not touch it.