Triage a Playwright Strict Mode Error Before Editing the Locator
A Playwright strict mode error means a locator matched multiple elements. Inspect the matches before changing the test.

A Playwright strict mode error says an action had more than one target. Paste the causal line into Test Failure Triage for a likely failure pattern and diagnostic checks, then inspect the actual matches before editing the locator.
Feed it the first causal line
Paste this reduced error into the “Failure evidence” field:
Error: strict mode violation: locator("button") resolved to 2 elements
Try this in Test Failure Triage
The live page classifies it as Selector drift, with high confidence. It says a locator expected one element but matched more than one. Its first repair suggestion is to add a unique accessible name or stable test ID at the product boundary. The diagnostic list asks you to inspect every match, compare role, label, and test-ID candidates, then check visibility and responsive containers. It links to the full strict mode violation guide.
That result is a hypothesis grounded in a known error signature. It is not proof that the UI regressed. Two “Save” buttons might be legitimate: one in a dialog and one in the page behind it. The right repair could be scoping the locator to the dialog, rather than renaming either button.
Inspect the candidates on the failing page
In Playwright, check the count and names before changing the action:
const saveButtons = page.getByRole('button', { name: 'Save' });
console.log(await saveButtons.count());
Then inspect the trace from the failing run. A count of two in a pasted HTML sample can help, but the rendered page and trace show the actual responsive state. Playwright's strictness applies to actions that require a single target; a broad locator can be valid for counting and still be invalid for clicking.
The rule set has a boundary
The site runs deterministic matching rules in the browser. It does not upload this text for model analysis. A recognized signature gives a classification, confidence, and maintained guide; unfamiliar text returns “No deterministic match.” A high-confidence label means the rule matched strongly, not that the first suggested fix is certainly correct. Preserve the original trace and stack, and reduce sensitive data before sharing evidence elsewhere.
The broader failure triage toolkit article covers capture, retries, and CI artifacts. This page is for the first local classification. Use traces and the actual DOM to decide the repair.