Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Add Self-Healing to Selenium Tests

Add locator recovery to Selenium with Healenium-Web or Healenium-Proxy, then verify healed selectors so a passing rerun does not conceal a real defect.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Self-healing is an added recovery layer, not a built-in Selenium feature. One documented route is Healenium-Web for Java: establish a successful locator baseline, start Healenium’s backend, add the library, and wrap your WebDriver with SelfHealingDriver. For JavaScript, Python, and C# clients, Healenium documents a proxy integration. In either case, review healed locators: a test that resumes after a UI change does not by itself prove the intended behavior still works.

Choose an integration that fits your test suite

Healenium documents two integration paths. The Java library runs in test code; the proxy sits between a Selenium client and Selenium server. Neither makes healing a substitute for assertions or for maintaining tests.

As an Amazon Associate I earn from qualifying purchases.

Decision Healenium-Web Healenium-Proxy
Client languages Java, according to Healenium documentation Java, Python, JavaScript, and C#, according to Healenium documentation
Integration point Wrap the test’s WebDriver in code Connect a RemoteWebDriver through the proxy
Operations Requires the Healenium backend Requires a proxy and backend service stack
Review controls Healing flags, score configuration, and reports Verify client/framework configuration and review healed output

Healenium’s documented service stack can include PostgreSQL for reference selectors, healing, reports, and DOM, as well as the proxy, backend, and selector imitator. Account for that deployment and maintenance work in a proof of concept. Confirm current compatibility with your Selenium, browser, and framework versions before adoption. Healenium-Web repository · Healenium documentation

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How locator healing works

Healenium’s documented workflow stores locator information from a successful run. On a later run, if a locator no longer finds its element, the tool catches NoSuchElementException, compares the current page state with the stored successful locator path, and generates candidate locators. It selects the highest-scoring candidate to continue, and can produce a report containing the healed locator and a screenshot. Healenium documentation

This flow addresses a specific problem: locating a target after a page change. It does not establish that every Selenium failure can be healed, nor that the replacement locator identifies the right control or that the application behavior is correct. Treat a successful continuation as a signal to inspect the change.

Java setup with Healenium-Web

The integration sequence is to start the backend, add the dependency, create your normal driver, and wrap it. The Healenium-Web README reviewed on October 3, 2026 listed version 3.5.8; check the repository for the current release and its compatibility before pinning a version. The exact Maven coordinates and backend startup details can change, so use the project’s current README and documentation rather than copying stale setup commands. Healenium-Web README

  1. Start the Healenium backend and any required services using the current Healenium setup instructions.
  2. Add the published healenium-web dependency at a release compatible with your Java and Selenium versions.
  3. Create the WebDriver your test already uses.
  4. Wrap that driver with SelfHealingDriver and use the wrapped driver for the test.
  5. Run the suite successfully to establish the locator baseline before evaluating a later healing event.

The repository also documents controls such as recovery-tries, score-cap, and heal-enabled. Consult the current README for their supported syntax and defaults; do not assume values from an older release apply to yours. Healenium-Web README

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Proxy setup for JavaScript, Python, and C# clients

For a multi-language suite, Healenium describes a proxy-based arrangement: run the proxy and backend, then configure the Selenium client as a RemoteWebDriver whose remote endpoint is the proxy. Healenium lists Java, Python, JavaScript, and C# clients for this approach. The endpoint, capabilities, and framework-specific details must match the proxy release you deploy; follow its documentation rather than substituting a regular Selenium server URL. Healenium documentation

This approach can centralize integration across different client languages, but adds services to operate. Validate your exact language binding, Selenium version, browser setup, and deployment topology in a small suite before routing a larger test fleet through it.

Roll out healing without masking defects

  1. Keep a failure record. Save the original failure, page state, healed locator, screenshot, and resulting application state when healing occurs.
  2. Review the candidate. Confirm that it identifies the intended element in the running application and that the test’s assertion still checks the required behavior.
  3. Disable healing for absence checks. If the expected result is that a button or other element is absent, healing could turn a meaningful missing-element failure into a pass. Healenium’s README shows disabling healing for a method that checks whether a button is present; use the current documented configuration for the equivalent case in your version. Healenium-Web README
  4. Promote good repairs deliberately. If a candidate is correct, update the maintained test locator rather than relying indefinitely on recovery.
  5. Repeat focused runs. Selenium recommends verifying generated locators against the live application, reviewing proposals, and repeatedly running a focused test. Avoid sleeps and absolute XPath patterns; a single pass does not establish that a test is free from races. Selenium locator guidance

Selenium’s AI-agent guidance also cautions teams to provide current documentation and project conventions: older Selenium examples may use removed APIs or brittle patterns. Keep any generated or copied setup aligned with the Selenium version actually in the project. Selenium documentation

Troubleshooting common problems

  • The first run does not heal. The documented workflow depends on a previously successful run that establishes a locator baseline. First verify that the normal test can pass and that the baseline data is being stored by the configured Healenium services.
  • A failed lookup remains a failure. Healing is documented around a missing-element lookup after a page change, not every failure class. Inspect the exception and determine whether the failure is actually a changed locator, rather than assuming the tool should recover it.
  • The proxy client cannot connect. Check that the proxy is running and that the RemoteWebDriver endpoint points to it, not directly to the Selenium server. Confirm the client configuration against the deployed proxy version.
  • A test passes but the result looks wrong. Inspect the report, candidate locator, screenshot, and application state. A successful rerun is not proof the locator is semantically correct.
  • An absence assertion unexpectedly passes. Disable healing for that check so the missing element remains a failure when absence is the expected condition.
  • Dependency or API examples do not compile. Recheck Healenium’s current release and compatibility with the project’s Selenium and Java versions; examples and supported APIs can differ across releases.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For capturing a page as an image or PDF, ScreenshotNeo is a separate website screenshot API; it does not add locator healing to Selenium tests. Its one-call API can return a screenshot directly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month, no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.