Autoheal
abstract
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 related settings
Autoheal is disabled by default.- To enable Autoheal globally, set
sahi.autoheal.enabled=true
in<sahi_pro>/userdata/userdata.properties
- To enable at suite execution level,
- From Editor Playback, check
Enable Autoheal:
checkbox. - From ANT target, add
<property name="isAutohealEnabled" value="true"/>
- From Editor Playback, check
-
sahi.autoheal.disabled_apis
: userdata property is provided to disable autoheal for apis 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.