Assertions and auto-heal
How assertions work with auto-heal
Ensuring successful auto-heals
For any recorded step in a mabl browser test, if the target element cannot be found during the test run using the attributes mabl already knows about it, mabl will look for similar elements using auto-heal in an attempt to find the correct element after potential changes. 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. Just as important, assertions help prevent tests from auto-healing to the wrong element. If the assertion (and the test) fails, the auto-heal doesn't get saved.
Assertions with Configure Find
If you want to create a recorded assertion that checks whether something "is present" or "is not present", you can use Configure Find to specify which attributes are the most important and the time that mabl should wait for a matching element (up to 15 minutes).
When you set up Configure Find, you also need to indicate whether or not you want mabl to use auto-heal to widen its search if it doesn't find the target in time.
If an "is present" or "is not present" assertion uses auto-heal, you should 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, you can select "Disable auto-heal."
Updated about 1 month ago