> ## Documentation Index
> Fetch the complete documentation index at: https://qodex.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# My tests are flaky. What does Qodex do about it?

> Qodex classifies failures, repairs many UI replay issues, and requires evidence before turning failures into findings.

# My tests are flaky. What does Qodex do about it?

Qodex tries to separate product bugs from noisy test failures.

When a run fails, Qodex looks at the evidence and classifies the failure as a real bug, stale test, or environment issue. For UI scenarios, it can also recover from many selector and layout changes.

## Failure classification

| Classification      | Meaning                                         | What to do                               |
| ------------------- | ----------------------------------------------- | ---------------------------------------- |
| `REAL_BUG`          | The product behavior appears broken             | Use the finding evidence to fix the app. |
| `STALE_TEST`        | The scenario no longer matches the product      | Update or regenerate the scenario.       |
| `ENVIRONMENT_ISSUE` | The target, network, data, or auth setup failed | Fix the environment and rerun.           |

This keeps temporary staging problems and stale selectors from automatically becoming product findings.

## UI replay recovery

UI scenarios replay cached browser actions.

If a selector changes but the step intent still makes sense, Qodex can resolve the intent against the current page and continue. A small label, layout, or selector change does not always require a manual test update.

## Evidence guard

Qodex expects evidence before opening high-severity findings.

That evidence may include a screenshot, DOM snapshot, request, response, console output, or replay trace. This reduces the chance that a single missed selector becomes a confident product bug.

## What you should do

* For `STALE_TEST`, update the scenario and rerun it.
* For `ENVIRONMENT_ISSUE`, fix the target, data, network, or auth setup.
* For `REAL_BUG`, review the evidence and fix the product behavior.

## Roadmap

A rolling flakiness score per scenario is planned. That will help Qodex treat frequently noisy tests differently from newly failing tests.

## Next steps

<CardGroup cols={2}>
  <Card title="Failure classification" icon="filter" href="/findings-failure-classification">
    Learn the three failure types.
  </Card>

  <Card title="Replay cache and self-healing" icon="recycle" href="/ui-testing-replay-cache">
    See how UI recovery works.
  </Card>

  <Card title="Findings" icon="circle-info" href="/concepts-findings">
    Understand what becomes a finding.
  </Card>

  <Card title="Re-run failed tests" icon="rotate-ccw" href="/run-tests-rerun-failed">
    Rerun only failed scenarios.
  </Card>
</CardGroup>
