Skip to content
OpenSmartRoute
Skillv1.0.0

self-heal

Automatically diagnose and fix broken locators in test files when elements change on the page. Use when tests are failing due to changed elements, broken selectors, or stale locators.

by harikch2209(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from harikch2209/AITestAgent (skills/self-heal/SKILL.md). Install upstream with npx skills add harikch2209/AITestAgent --skill self-heal. Copyright stays with the author.

Self-Heal

Automatically fixes broken locators at runtime when elements change on the page.

When to Use

  • Tests are failing because page elements have changed
  • Locator selectors are stale or broken
  • User says "fix my broken tests" or "update locators"

How It Works

When a locator fails during test execution, the self-healer:

  1. Try alternative strategies: If CSS selector fails, try getByRole, getByPlaceholder, getByLabel based on the element name
  2. Fuzzy text match: Search for elements with similar visible text
  3. DOM scan: Scan the page for elements matching the expected type, score candidates by attribute similarity
  4. Auto-update: If healed, update the locator JSON file for future runs

Configuration

Self-healing is enabled by default. Disable with:

npm start -- --file tests/login.md --no-self-heal

Report Integration

Healed locators are marked in the HTML report with the original and new locator strategies, along with a confidence score.

[ PASS ] Click on "Login Button" (234ms) [HEALED]
    Self-healed: css:"#old-login-btn" → getByRole:"button" (80% confidence)

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/harikch2209-aitestagent-self-heal/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

harikch2209-aitestagent-self-heal.ocm.jsonjson
{
  "ocm": "1",
  "id": "harikch2209-aitestagent-self-heal",
  "kind": "skill",
  "name": "self-heal",
  "description": "Automatically diagnose and fix broken locators in test files when elements change on the page. Use when tests are failing due to changed elements, broken selectors, or stale locators.",
  "publisher": "harikch2209",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "self-healing",
      "locators",
      "maintenance",
      "resilience",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Automatically diagnose and fix broken locators in test files when elements change on the page. Use when tests are failing due to changed elements, broken selectors, or stale locators."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/harikch2209/AITestAgent",
      "path": "skills/self-heal/SKILL.md",
      "ref": "9b4e6dc7c0c2b71cabce09d15de5ff3d53fa23b5",
      "url": "https://github.com/harikch2209/AITestAgent/blob/9b4e6dc7c0c2b71cabce09d15de5ff3d53fa23b5/skills/self-heal/SKILL.md",
      "key": "harikch2209/AITestAgent/skills/self-heal/SKILL.md"
    }
  },
  "instructions": "# Self-Heal\n\nAutomatically fixes broken locators at runtime when elements change on the page.\n\n## When to Use\n\n- Tests are failing because page elements have changed\n- Locator selectors are stale or broken\n- User says \"fix my broken tests\" or \"update locators\"\n\n## How It Works\n\nWhen a locator fails during test execution, the self-healer:\n\n1. **Try alternative strategies**: If CSS selector fails, try getByRole, getByPlaceholder, getByLabel based on the element name\n2. **Fuzzy text match**: Search for elements with similar visible text\n3. **DOM scan**: Scan the page for elements matching the exp",
  "cost": {
    "context_tokens": 285
  }
}

Fetch it by URL: GET /api/v1/registry/harikch2209-aitestagent-self-heal/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.