In browser tests, if a target element cannot be found using its known attributes, mabl uses auto-heal to look for a similar element that is a strong match. While there are some nuances to this process, at a basic level the rules are as follows:
- If the test passes, the auto-heal is saved.
- If it fails, the auto-heal is not saved.
Assertions are an important part of this process. They help ensure that auto-healed test steps are still identifying the correct element and prevent tests from auto-healing to the wrong element. If the assertion fails, the auto-heal doesn't get saved.
Assertions with Configure Find
When you assert on an element, Configure Find to specify which attributes are the most important and enable auto-heal to widen its search if it doesn't find the target.
If an "is present" or "is not present" assertion uses auto-heal, keep in mind the following:
- If an "is present" assertion auto-heals to a different element that matches Configure Find settings, the assertion will pass.
- If an "is not present" assertion auto-heals to a different element that matches the Configure Find settings, the assertion will fail.
This behavior could result in false passes and false failures. If you do not want an assertion to auto-heal to a different element, make sure "Disable auto-heal" is selected.