Playwright / Scenario

Strict Mode Standoff

One locator, three Add buttons, zero clicks. Read the strict mode violation and choose the fix that targets intent, not luck.

Difficulty
Easy
Format
Scenario
Points
100
Estimate
10 min

// MISSION BRIEF

Your Mission

A junior engineer's new test for the product grid dies instantly with a strict mode violation. They are five minutes from "fixing" it with .first() and moving on.

Read the error, the test, and the DOM sketch. Then make the calls: what happened, what is the right fix, and why the quick one bites back.

Decisions are weighted; partial credit exists for defensible-but-worse choices.

// FIRST CONTACT

Battle teaser

First artifact

Test failure output

What is the error actually telling you?

  1. AThe locator matched 3 elements, and Playwright refuses to guess which one an action should target
  2. BThe role 'button' is invalid for this element
  3. CThree tests are running in parallel against one page
  4. DThe button is not yet visible, a timing failure
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

playwrightlocatorsstrict-modedebugginge2e-testing