Bengaluru, India · Global delivery
Back to home
Product — Playwright Modular Locator Engine

Locator Framework

A pluggable Strategy-pattern locator engine for UI test automation — when the primary locator goes stale, it falls through to the next strategy and logs exactly which one healed it.

Core9/9 PassingPlaywrightpytestOpenCV
The problem

UI tests break when one element locator changes, even if the feature works.

What it does

Falls back to the next locator strategy and logs exactly which one healed the test.

The result

9 of 9 tests passing, including against a live website.

The problem

UI test automation frequently fails not from feature regression, but from a single fragile element locator shifting beneath an otherwise-unchanged interface — with most frameworks either failing outright or silently masking the degradation through undocumented fallback behavior.

Who it is for

  • Organizations maintaining substantial UI test suites experiencing recurring failures from cosmetic, non-functional interface changes
  • QA engineering teams requiring visibility into which specific locator strategy resolved element identification, beyond binary pass/fail reporting

Market context

Self-healing locator technology is a mature, established capability across the category — Testim, Mabl, and Applitools each provide AI-assisted selector healing as a component of broader platform offerings.

The gap it closes

Most self-healing implementations are architected to fail silently while preserving a passing test suite status — resolving immediate breakage while concealing progressive degradation of the primary locator until complete failure occurs, without prior warning.

How it works

  • A primary locator strategy is attempted first, under standard operating conditions
  • Upon failure, the framework proceeds through a defined fallback sequence — identifier, then visible text, then class match, then visual matching via OpenCV
  • Every instance of fallback resolution (rather than primary) is explicitly logged, recording the specific successful strategy

What makes it different

  • Degradation visibility as a core design principle — fallback reliance is surfaced as an explicit early-warning signal, not concealed behind a passing status
  • Verified visual-matching fallback (OpenCV template matching) — validated to correctly report negative results against unrelated imagery rather than producing false positives

Architecture

System Overview

Attempt Primary Locator (ID) │ Failed? ▼ Fallback: Visible Text │ Failed? ▼ Fallback: Class Match │ Failed? ▼ Fallback: Visual Match (OpenCV) ── tested to correctly report "not found" on unrelated images ── │ ▼ Every Fallback Use Explicitly Logged

Component Breakdown

Strategy InterfaceCommon contract every locator strategy implements
4 Concrete StrategiesID → visible text → class match → OpenCV visual, tried in order
Fallback LoggerExplicitly records every instance a fallback resolved an element
OpenCV Visual MatcherThe final-resort strategy, verified against unrelated imagery

Data Flow

  1. A test attempts to locate an element using the primary strategy
  2. On failure, the framework falls through the defined chain
  3. Each fallback resolution is explicitly logged
  4. If every strategy fails, a 'not found' is reported, not a false positive

Technology Stack

Test frameworkPlaywrightReal browser automation target
Design patternStrategy patternClean pluggability for new fallback strategies
Visual fallbackOpenCV template matchingA last-resort strategy
Test runnerpytest9 real tests, synthetic HTML and a real live site

Real Design Trade-off, Documented

Most self-healing locators fail silently to preserve a green suite. This framework logs every fallback use as a visible signal, accepting noisier output in exchange for catching degradation before complete failure.

Performance, Measured Not Estimated

  • 9/9 tests passing, validated against synthetic HTML and a real live website
  • The OpenCV fallback tested for honesty: fed an unrelated image, correctly reported 'not found'

See Locator Framework working

A guided walkthrough, one-on-one. We usually reply within one business day.

Request access →
Next step

Stop guessing whether your AI is safe to ship.

Tell us about one AI system. In 30 minutes we will show you where it can fail silently, and what it would take to prove it does not.