Use the Self-Healing function in Katalon Recorder
On some websites, automation scripts can fail because the default locator fails to find an element. In that case, Self-Healing will automatically try out other locators. If it finds a valid locator, it will continue the automation script using that locator and records the broken and valid locators for later use.
Enabling and disabling Self-Healing
Self-healing is enabled by default.
You can disable it by following these steps:
-
Go to Settings > Self-Healing.
-
Uncheck Enable Self-Healing execution.
-
Save and close.
Prioritizing locator methods in Self-Healing
Self-Healing uses 3 locator methods, in this priority order: id, css, xpath. However, the best locator methods may vary depending on your websites under test.
You can change the order of locator methods by following these steps:
-
Go to Settings > Self-Healing.
-
Make sure Self-Healing is enabled.
-
Drag and drop the locator methods in the order of your choosing.
-
Save and close.
Excluding certain commands from Self-Healing
Some commands validate that a particular element exists on a certain page. We advise you to not trigger Self-Healing on these commands, as it encurs the risk of validating elements incorrectly.
By default, verifyElementPresent
,verifyElementNotPresent
,assertElementPresent
andassertElementNotPresent
commands are excluded from Self-Healing.
You can choose to exclude certain commands from Self-Healing by following these steps:
-
Go to Settings > Self-Healing.
-
Make sure Self-Healing is enabled.
-
Add the commands you want to exclude to the list.
-
Save and close.
Regex is also supported for excluding commands. For example, you can exclude all command starting with the keywordwaitFor by adding ^waitFor to the list.
Approving Self-Healing proposals
When the default locator fails, Self-Healing finds alternative locators to complete the test execution. After the test execution is completed, you can choose to replace failing locators by approving Self-Healing suggestions.
The Self-Healing tab is refreshed on every new execution.
To approve Self-healing suggestions, follow these steps:
-
Go to the Self-Healing tab.
-
Select the suggested locators using the status filter.
-
Press Approve.