# Self-healing locator

A way of finding an element on a page that survives when the page changes, by trying several candidates and repairing itself when all of them miss.

Kaabist records every element with ranked candidates: a test id, a role and name, a stable id, exact text. When a site is redesigned and none of them matches, the job compares the page with its last good snapshot, finds the element that plays the same part, and proposes the new locator for you to approve.

```
{
  "click": {
    "candidates": [
      {
        "testid": "export-button"
      },
      {
        "role": "button",
        "name": "Export"
      },
      {
        "text": "Export",
        "exact": true
      }
    ]
  }
}
```

## Related

- [Self-healing locators](/product/self-healing)
- [Turn a website into an API](/use-cases/website-to-api)
- [Locator candidates](/glossary/locator-candidates)
- [Proposal](/glossary/proposal)
- [Drift](/glossary/drift)
