Self-Healing Tests

Self-Healing Tests in Endtest automatically recover from broken locators when your UI changes, reducing maintenance and eliminating flaky test failures.

Self-Healing helps reduce test maintenance by automatically repairing broken element locators during test execution.

When your application changes, an element might still be visible on the page, but the locator used by the test step may no longer match it. For example, a developer might change an element ID, update the page structure, or modify attributes used by your test.

Instead of requiring you to manually update the step, Endtest can find the correct element again and update the locator automatically.

How Self-Healing Works

When Self-Healing is enabled and an element cannot be found, Endtest tries to repair the affected step automatically.

First, Endtest checks the backup locators that were previously stored for that element.

If one of those backup locators identifies the correct element, Endtest uses it and updates the step automatically.

If backup locators are not available, Endtest uses AI to find an alternative locator for the element.

This means Self-Healing can still repair steps even if Store Backup Locators was not enabled in previous runs.

Store Backup Locators

The Store Backup Locators option allows Endtest to store additional locators for the elements used in your test.

These backup locators give Self-Healing more ways to identify the same element in future executions.

Having Store Backup Locators enabled in previous successful test runs increases the chances of Self-Healing repairing steps quickly and accurately when your application changes.

Safety Backup

When Self-Healing is enabled, Endtest automatically creates a backup of the test suite at the start of the execution.

This backup is created as a precaution, in case a step is updated incorrectly.

You can use the backup to review or restore the previous version of the test suite if needed.

Steps

  1. Go to the Settings screen for your test suite.
  2. Open the Advanced tab.
  3. Enable Store Backup Locators.
  4. Execute your test at least once. During this run, Endtest stores additional locators for the elements used by your test.
  5. Return to the Advanced tab.
  6. Enable Self-Healing.
  7. Run your test again. If an element cannot be found, Endtest will first try the stored backup locators. If backup locators are not available, Endtest will use AI to find an alternative locator.
  8. When a working locator is found, Endtest updates the step automatically.

For best results, enable Store Backup Locators on stable test runs.

This allows Endtest to collect additional locators for the elements in your test, making future Self-Healing runs faster and more accurate.

You can also enable Self-Healing directly, even if Store Backup Locators was not enabled before. In that case, Endtest will use AI to find an alternative locator when needed.

Summary

Self-Healing helps keep your tests stable when your application changes.

It can:

  • use previously stored backup locators
  • use AI to find an alternative locator
  • automatically update the affected step
  • create a test suite backup before making changes

This reduces the amount of manual maintenance needed when locators change in your application.