VigilQA Docs
Post-run Agent

FlakyDetector

Analyses run history to compute per-test stability scores and identify whether flakiness is caused by locator instability — triggering LocatorHealer when it is.

Trigger

FlakyDetector is triggered when ResultAnalyzer classifies one or more tests in a run as Flaky. It runs on each flagged test independently.

Stability score

For each flagged test, FlakyDetector fetches the test's run history (last 5 runs by default) and computes a stability score between 0 and 1:

  • 1.0 — test has passed in every one of the last 5 runs (not flaky)
  • 0.6–0.99 — test has occasional failures with no pattern (mildly flaky)
  • 0.0–0.59 — test fails frequently or in a recognisable pattern (significantly flaky)

Tests scoring below the configured threshold (default: 0.75) are marked as unstable and appear in the Flaky Tests report on the dashboard.

Locator instability detection

For each unstable test, FlakyDetector checks whether the failure pattern correlates with locator errors (element not found, selector timeout). It compares the AppExplorer selector snapshots from the current run against the snapshot at the time the test was last stable.

If selector changes are detected that align with the flakiness pattern, FlakyDetector raises a locator instability flag and queues LocatorHealer to re-discover the affected selectors.

Outputs

OutputWhere to find it
Stability score per testRun results → Agent Activity → FlakyDetector output; also shown on the test's history page
Unstable test listDashboard → Flaky Tests report
Locator instability flagShown on the specific test in Flaky Tests report; triggers LocatorHealer automatically
Pattern summaryFlakyDetector agent output includes a text summary of the instability pattern observed

Configuration

Navigate to Project Settings → Agents → FlakyDetector:

  • History window — number of past runs to analyse (default: 5, max: 20)
  • Stability threshold — score below which a test is marked unstable (default: 0.75)
  • Auto-queue LocatorHealer — whether to automatically trigger LocatorHealer when locator instability is detected (default: enabled)

Tests with a stability score below 0.5 are automatically quarantined — excluded from blocking the CI/CD run — until resolved. This prevents a persistently flaky test from blocking deployments while it's being investigated.