Project | Web & API
Self-Healing Selenium Tests with Healenium
A demo shop with two releases at the same URL, tested through the same page objects: learn on release 1, heal on release 2 on day one and after review, and a control run without Healenium. Every heal goes into a journal with its top 5 candidates, their scores and a screenshot of the proposed element.
On 27 Nov 2026: 41 tests passed in CI. Of the 18 heals Healenium proposed on release 2, 16 were approved and used and 2 were rejected and stopped; the review gate failed on day one (7 heals used without review) and passed after review.
Evidence checked 27 Nov 2026 | CI run on main
On this page
Problem and purpose
Locators break after every redesign, and fixing them by hand is slow. Healenium promises to find the moved element on its own. This project measures that promise on real runs: Healenium healed all 18 out-of-date locators, and 2 of those heals picked the wrong element. One of the two won clearly, 0.897 against 0.781, so no score rule can catch it.
Controlled healing adds two checks on top of Healenium. A heal is used only when it has a clear winner, and every heal gets a verdict in a reviewed file in the repository. A review gate fails the build for heals nobody has looked at, and a rejected heal stops the lookup instead of handing the test the wrong element.
Architecture
test ──► page object ──► SelfHealingDriver.findElement(locator)
│ found ──► save the element (tag, attributes, path) in hlm-backend
└ not found ──► Healenium scores every candidate, proposes the best
──► GuardedHealingService: journal it, then
rejected in review ──► stop
approved in review ──► use
runner-up within 0.05 ──► stop
otherwise ──► use; the review gate fails the runTechnology and tools
| Area | Tools |
|---|---|
| Tests | Java 21, Selenium 4, TestNG: 41 tests in six steps (healing rules, learn on release 1, release 2 on day one and after review, control without healing, review gate) |
| Self-healing | healenium-web 3.6.0 wraps ChromeDriver; hlm-backend 4.0.0 pinned by digest, selector-imitator 1.6 and Postgres in Docker Compose |
| Controlled healing | GuardedHealingService takes over Healenium's healing service: a clear-winner margin of 0.05, reviewed heals in approved-heals.json, a heal journal with screenshots, and a review gate |
| Application | A demo shop in the repository (JDK HTTP server) with two releases deployed at the same URL |
| CI | GitHub Actions: starts the Healenium backend, runs all 41 tests, writes the used heals and both review reports into the job summary, keeps the heal journal as an artifact; weekly scheduled run |
Engineering decisions and approach
- Healenium picks first, then the guard reads its full ranking: none of Healenium's set-up code is copied
- A clear winner is not enough: a reviewed verdict in the repository decides, one verdict per exact heal
- A heal nobody has reviewed is used for that run but fails the review gate, which proposes the entry to fill in
- The same journeys and page objects run in every step; only the release, the driver and the reviewed heals change
- Absence checks never heal (@DisableHealing), and are paired with a positive check
Test scope and execution approach
Project-specific checks and execution details documented in the repository:
- Heal journal: test, page-object method, old and new locator, the top 5 candidates with scores, the decision, and a screenshot with the proposed element outlined
- Review reports in the CI job summary: day one fails by design (7 heals used without review), after review it passes
- Real scores behind the rules: the look-alike buttons tie and are right only by listing order, the error box ties and is wrong, the button label wins clearly and is wrong
- Found on the way: hlm-backend uploads healing metrics with the page DOM to an external endpoint by default, and Healenium's highlight border changes the page under test; both switched off
- Page Object Model with components, fluent navigation, a driver factory and test data objects
Results with dated evidence
Historical repository or workflow evidence
CI run on main
On 27 Nov 2026: 41 tests passed in CI. Of the 18 heals Healenium proposed on release 2, 16 were approved and used and 2 were rejected and stopped; the review gate failed on day one (7 heals used without review) and passed after review.
Evidence checked: | Open dated evidence
Evidence explorer
Static screenshots are labelled as images; dated workflow links identify the execution evidence and its check date.
Real scores on release 2: the three look-alike buttons tie (0.897 and 0.897), the error box ties with the new wrapper (0.800 and 0.800), and the wrong button label wins clearly (0.897 against 0.781). The clear-winner rule stops both ties, including the one that was right only by luck; only the review stops the third.
Static material from the public repository. The linked verification record was checked 2026-11-27; that date is not a screenshot capture date.
Dated workflow record
Evidence checked 2026-11-27. Open CI run on main
Local setup and execution
docker compose -f infra/docker-compose.yml up -d --wait
mvnw.cmd verify :: 41 tests, Java 21, Chrome, Docker
dir target\healing :: heal journal, review reports, screenshotsWorkflow and reports
Known limitations
- The demo shop and its redesign were written for this project; another application will heal better or worse
- Self-healing cannot tell look-alike siblings apart; stable test hooks such as data-testid are still needed
- Reviewed heals are not written back to the page objects: the locator should still be fixed in code
- The demo shop and its redesign are written for the project; healing quality on another application will differ, and reviewed heals still need fixing in the page objects.