# Flaky Tests, Locator Repairs and Release Readiness You Can Defend

> Release 6 of the TR AI Software Test Engineer adds test intelligence to Test Studio: flaky tests worked out from run history and tracked apart from defects, locator repair suggestions that go through review, test selection for a change with a reason for every test, and release quality reports that are only "Ready" when every criterion is met on recorded evidence. How each part works, what it refuses to do, an illustrative worked example, five scenarios and a step-by-step guide.

Source: https://www.ticketresolve.ai/blog/test-intelligence-release-quality · Published 2026-11-19 · TicketResolve AI

**Every test suite eventually develops the same three problems. Some tests fail now and then for reasons nobody can pin down, so people start ignoring red. Some tests break because a button's generated ID changed, not because the product did. And when release day comes, "are we ready?" gets answered with a pass percentage that hides which tests never ran.**

**Release 6 of the TR AI Software Test Engineer adds test intelligence to Test Studio to deal with all three, plus a way to run only the tests a change needs. It finds flaky tests from your run history and keeps them apart from real defects. It suggests locator repairs, which go through the same review as any other test change. It picks the tests a change touches and explains each choice. And it produces release quality reports that won't say "Ready" unless every criterion you set is met on evidence it can show you. There's also an optional TestRail connection for teams that already use TestRail.**

A few terms used in this post:

- **A run** is one execution of an approved test version on an environment, in Test Studio Desktop.
- **A flip** is a run whose result differs from the one before it, on the same test version.
- **A locator** is how a test finds an element: a test ID, a role and accessible name, a label, a CSS selector. Each recorded step keeps its main locator plus a few alternatives.
- **Quarantine** means a test still runs, but its results are treated as weak evidence until it's fixed.
- **A release quality report** is a snapshot of the evidence for a release, checked against your criteria, which someone then approves or rejects.

If you're new to Test Studio, [the AI Software Test Engineer overview](https://www.ticketresolve.ai/blog/ai-software-test-engineer) and [Test Studio Desktop](https://www.ticketresolve.ai/blog/test-studio-desktop) explain recording, review and runs.

## The problem, in plain terms

Flaky tests are expensive in a quiet way. Each one teaches the team that a red result might not mean anything, and after enough of those, real failures get rerun until they pass. The usual fix, a spreadsheet of "known flaky tests", goes stale within a sprint.

Broken locators are the other big source of noise. A redesign changes a class name, twenty tests fail, and someone spends a day updating selectors by hand. The tempting shortcut, "self-healing" that silently picks a different element, is worse: a test that quietly clicks something else can pass while the product is broken.

And release readiness is usually a number: 96% passed. That number doesn't say whether the 4% included the checkout test, whether a third of the plan never ran, or whether the results are from last month.

## Part 1: flaky tests, from run history

For each test on each environment, Test Studio looks at the last 90 days of finished runs and asks a few concrete questions:

| Signal | What it means |
|---|---|
| Switches between pass and fail on the same version | The test or the environment is unstable; nobody changed the test |
| Passed only after a retry | The first attempt failed for a reason that went away |
| Failure analysed as intermittent | Release 4's failure analysis already thought so |
| Fails in one browser, passes in others | A browser-specific timing or rendering issue |

From those it gives each test a verdict: **stable**, **suspected** or **flaky**, plus the reasons in plain words and the kinds of instability it saw: timing, element not found, network, test data collisions, environment errors, one browser only.

Two cases are deliberately *not* called flaky. A test that fails every time is a consistent failure: either a defect or a broken test, and it belongs in defects. A test that failed on version 3 and passes on version 4 was fixed: a new version resets the comparison.

Someone who writes tests can mark a test **confirmed flaky**. Quarantining it, clearing it ("not flaky") or marking it fixed takes a QA lead or manager, and quarantining or clearing needs a reason. All of it sits in its own list, separate from defects, so "the search test is flaky" and "search is broken" don't get confused.

## Part 2: locator repairs, suggested and reviewed

When a step can't find its element, Test Studio Desktop does one extra thing before reporting the failure: it checks how many visible elements each locator recorded with that step matches right now. It only checks locators that are already in the test, and it sends back only the counts. Nothing else from the page leaves your computer.

**The run still fails.** The alternatives are never used to pass it.

Back in Test Studio, if exactly one recorded alternative matched exactly one visible element, you get a suggestion: the old locator crossed out, the new one, and why ("the recorded locator matched nothing; the recorded alternative, a role and name, matched exactly one visible element"). If the main locator still matches one visible element, there's no suggestion: the problem isn't the locator.

**Accept and send for review** writes a new version of the test, with the new locator as primary and the old one kept as an alternative, and submits it for the normal review. The person who accepted it can't approve it, and runs keep using the approved version until someone else does. **Dismiss** is for when the page really changed and the test needs rethinking.

## Part 3: test selection for a change

Running every test on every pull request gets slow. Running a hand-picked few gets risky. Test selection sits in between.

First you map your code to **components**: a name, path patterns such as `src/checkout/**`, and the test tags that cover it. Tests also link to a component through the component names in their own definition, or by being listed on it.

Then you paste the files a change touches (`git diff --name-only main...HEAD` is enough). Test Studio:

- selects approved tests that cover a changed component,
- always adds critical tests,
- adds high-criticality tests when some changed files map to no component, and tells you which files to map,
- notes tests with recent failures, open defects or flakiness,
- and gives every test, in or out, a reason.

A QA lead can turn the selection straight into a test plan and run it in Test Studio Desktop.

## Part 4: release quality, on evidence

Each project has release criteria, set by a QA lead or manager:

| Criterion | Default |
|---|---|
| Plans that make up the evidence | chosen per release |
| Every critical test passed | on |
| Minimum pass rate | 100% |
| Open critical / high defects | 0 / 0 |
| Requirements verified by a passing test | 80%, and every critical requirement |
| Flaky or quarantined tests | 0 |
| Every plan signed off | on |
| Results no older than | 7 days |

**Check now** shows where things stand. **Generate report** takes a snapshot of the evidence: plans and their results, open defects, requirements coverage, flaky tests, and anything that weakens the evidence, such as tests that weren't run or plans run against production.

Each criterion is **met**, **not met** or **not enough evidence**, with the detail. The report is **Ready** only when every criterion is met. Tests that weren't run count against the pass rate, so 95 passes out of 100 planned is 95% even if only 95 ran. A criterion with no evidence (no plans chosen, no requirements recorded) is never treated as met.

A QA lead or manager other than the person who generated the report approves or rejects it. Only a Ready report can be approved; rejecting needs a reason. To change the outcome, you fix what isn't met, or deliberately change the criteria, and generate a new report. The old one stays.

## Part 5: TestRail, if you use it

Some teams keep TestRail as their test management system. A Test Studio manager can connect it with the TestRail address, a user, an API key (stored encrypted) and the project ID.

- **Import** adds each TestRail case once, as a draft manual test with its steps, expected results, priority and references, linked by its TestRail ID. Importing again doesn't duplicate anything.
- **Source of truth** decides what happens when a TestRail case changes: with TicketResolve as the source, existing tests aren't overwritten; with TestRail as the source, the change becomes a new version.
- **Send plan results** creates one TestRail run per plan (reused after that) and adds a result for each linked case. Where a case ran in several browsers, the worst result is sent.
- Rate limits are retried, and every connection test, import and push is in the sync log.

It follows TestRail's published API and has been tested against a simulated TestRail. It hasn't yet been verified against a live TestRail account, and Test Studio says so on the page.

## What it does, and what it doesn't

- It **does** tell you which tests are unstable and why; it **doesn't** hide or skip them.
- It **does** suggest a locator change; it **doesn't** change a test or pass a run on its own.
- It **does** pick tests for a change with reasons; it **doesn't** guarantee nothing else broke. Critical tests always run for that reason.
- It **does** report release readiness against your criteria; it **doesn't** approve a release. A person does, and not the one who generated the report.

## A worked example, start to finish

*An illustrative scenario, not a customer account.*

A 60-person B2B scheduling company runs about 180 approved tests across two environments.

1. The QA lead opens **Intelligence → Flaky tests**. Two tests are flaky: "Reschedule a booking" switched result five times in eleven runs on the same version, all timeouts; "Export calendar" fails only in WebKit. She quarantines the first with the note "waits on the search index; ENG-412 adds a ready signal" and confirms the second as flaky.
2. A redesign ships to staging and 14 runs fail. **Locator repairs** has 11 suggestions, mostly CSS classes replaced by role and name. A tester accepts nine; each becomes a new version in review. The QA lead approves them. Two looked wrong, so the tester dismissed them and rewrote those tests.
3. For the next pull request, a developer pastes 23 changed files. Test selection picks 31 tests: 19 covering Billing and Invoices, 8 critical tests, and 4 high-criticality tests because two files under `scripts/` map to no component. The QA lead maps `scripts/` and creates a plan.
4. On release day, **Check now** shows "not ready": one critical test failed in Firefox, and the quarantined test counts against the flaky limit. The team fixes the Firefox failure and reruns it. Then the QA lead raises the flaky limit to 1, with the reason recorded in the audit log, and generates a report.
5. The report is Ready. Its limitations list the quarantined test and two plan items that were blocked with reasons. The engineering manager, who didn't generate it, approves it.

## Five more real-world scenarios

*Illustrative scenarios.*

**A nightly run that's red every other night.** Flaky tests shows one test with eight switches, all "element not found" in one browser. It's a rendering race, not a product bug; the team adds a wait for a stable element and marks it fixed.

**A design system migration.** Hundreds of generated CSS classes change. Locator repairs suggests role-based locators wherever the step recorded one. Reviewers approve in batches; tests with no stable alternative show up as failures to rewrite, not silent passes.

**A one-line config change.** Test selection maps it to no component, so it adds critical and high-criticality tests and points at the unmapped file. Mapping it once makes the next change faster.

**An audit asks how release 3.8 was approved.** The release report shows the criteria, the evidence snapshot, who generated it, who approved it and when.

**A team moving off TestRail gradually.** They import their 900 cases with TicketResolve as the source of truth, keep sending results back to TestRail runs for the teams still reading them there, and move people over one squad at a time.

## Before and after

| Before | With test intelligence |
|---|---|
| A stale list of "known flaky" tests | Verdicts from run history, with reasons, kept apart from defects |
| Hours updating selectors by hand, or self-healing nobody reviewed | Suggested repairs from recorded alternatives, reviewed like any change |
| Every test on every change, or a guess | A selection with a reason for each test |
| "96% passed" | Every criterion met or not, on evidence, with the limitations listed |
| Two tools that don't talk | Optional TestRail import and results, logged |

## How to tell it's working

- The flaky list gets shorter as quarantined tests are fixed and marked so.
- Repairs are accepted and approved within a day of a UI change.
- Selected-test plans catch the failures a full run would have caught. Compare them now and then.
- Release reports show "met" on evidence you can open, not on a single number.

## Who it's for

QA leads and test managers who sign off releases, engineers who own suites that have grown noisy, and engineering managers who need to know why a release was approved. Test Studio is part of Engineering Intelligence; nothing is charged per test, run or report.

## Mistakes to avoid

- **Quarantining instead of fixing.** Quarantine is a holding state with a reason; release reports keep counting it.
- **Accepting every repair without looking.** A role and name that match one element may still be the wrong element. Check the screenshot of the failed run.
- **Leaving components unmapped.** Unmapped files make selection fall back to broad, high-criticality coverage.
- **Lowering criteria quietly to get a "Ready".** Changes are recorded; say why in the report decision.
- **Treating the TestRail connection as proven.** It hasn't been verified against a live TestRail yet. Try it on a test project first.

## Do it in TicketResolve, step by step

1. Open **Test Studio → Intelligence**. Review **Flaky tests** and decide on each flaky or suspected one.
2. Under **Locator repairs**, accept or dismiss suggestions; approve the new versions in **Review** (someone else).
3. Under **Test selection**, add components with path patterns and tags, paste changed files, and select tests. Create a plan from the selection if you're a QA lead.
4. Open **Release quality**, choose the plans and thresholds, and press **Check now**.
5. **Generate report** for the release; a QA lead or manager who didn't generate it approves or rejects it.
6. Optional: **TestRail** to connect, import cases and send plan results.

The full guide is [Flaky tests, locator repairs, test selection and release quality](https://www.ticketresolve.ai/docs/guide/tse-intelligence). Plans and coverage are covered in [Test plans, requirements coverage and CI results](https://www.ticketresolve.ai/docs/guide/tse-plans), and review in [Reviewing and approving tests](https://www.ticketresolve.ai/docs/guide/tse-review).

## Frequently asked questions

**Does Test Studio "self-heal" tests?**
No. It suggests a locator change from alternatives recorded with the step. The run that found the problem stays failed, and the change is a new version someone else has to approve.

**What data does the locator check send?**
For a failed step, how many elements each locator already in that step matched, and whether the first was visible. Locators that aren't in the test are dropped by the server.

**How many runs before a test can be called flaky?**
At least four finished runs on that environment. With fewer, it can still be "suspected" if it passed only on a retry or a failure was analysed as intermittent.

**Does a new test version reset flakiness?**
Switches only count on the same version, so a fixed test stops looking flaky as soon as the new version passes.

**Can a quarantined test fail a release?**
Quarantined and flaky tests count against the "flaky or quarantined" criterion, and the report lists them as limitations. Set the limit deliberately.

**Why does my report say "not enough evidence"?**
A criterion had nothing to judge: no plans chosen, no tests run, or no requirements recorded. It's never treated as met.

**Can the person who generated a report approve it?**
No. Another QA lead or manager has to, and only when it's Ready.

**Can I use test selection from CI?**
Today you paste the changed files in Test Studio. Pull-request triggers aren't wired yet.

**Is TestRail required?**
No. It's optional, and it hasn't been verified against a live TestRail account yet.

**What does it cost?**
It's part of Engineering Intelligence. Nothing is charged per test, run, report or sync.

## The short version

Release 6 makes test results something you can act on. Flaky tests are found from history and kept apart from defects. Broken locators get reviewed suggestions instead of silent healing. A change gets the tests it needs, with reasons. A release is approved only when every criterion is met on evidence, by someone other than the person who generated the report. Start at **Test Studio → Intelligence**.
