Skip to contentPlayForge
Act IIChapter 9
chapter 9

9. Locators I: What the User Sees

Find elements by role, label and text, the way a user does, and survive strict mode.

11m read11m in total

Chapter film (about 7m) is coming.

3 more checkpoints in this chapter

This chapter is part of Standard, which opens at launch. Its lessons are listed below.

  1. getByRole and the Accessible Name
  2. getByText, getByLabel, getByPlaceholder, getByTestId
  3. Strict Mode — One Locator, One Element
See what a full account includes

Practice

47 exercises attached to this chapter.

  • fixStrict mode violation🔒 standard
  • fixWhitespace and exact matching🔒 standard
  • fixStrict mode stops at line two🔒 standard
  • locatorThe button you can see🔒 standard
  • locatorAsk for the label🔒 standard
  • locatorThe checkbox🔒 standard
  • locatorThe error that announces itself🔒 standard
  • locatorName the landmark🔒 standard
  • locatorThe badge🔒 standard
  • locatorThe heading above the cards🔒 standard
  • locatorThree queues, one heading🔒 standard
  • locatorCase matters🔒 standard
  • locatorWhen position is the identity🔒 standard
  • locatorGrinder, not Grinder Mini🔒 standard
  • locatorThe name is in the aria-label🔒 standard
  • locatorThird recommendation🔒 standard
  • locatorSort by customer🔒 standard
  • locatorThe header that has no button🔒 standard
  • locatorCustomer contains🔒 standard
  • locatorThe modal by its name🔒 standard
  • locatorNothing matched🔒 standard
  • locatorCustomer name🔒 standard
  • locatorThe label that points nowhere🔒 standard
  • locatorThe custom radio🔒 standard
  • locatorOne combobox among many🔒 standard
  • locatorDrag the slider🔒 standard
  • locatorSwitching the active tab🔒 standard
  • locatorThe active tab panel🔒 standard
  • locatorThe real Approve🔒 elite
  • locatorAnd the fake one🔒 elite
  • locatorThree elements, one test id🔒 elite
  • locatorThe amount no leaf contains🔒 elite
  • locatorNormalised whitespace🔒 elite
  • locatorThe last toast🔒 elite
  • locatorForce a 500🔒 elite
  • locatorStatus and elapsed🔒 elite
  • locatorThe failure banner🔒 elite
  • predictStrict mode refusal🔒 standard
  • predictExact whitespace🔒 standard
  • predictQuestion it can answer🔒 standard
  • predictLocators: Broken Labels🔒 standard
  • predictLocators: Implicit Labels🔒 standard
  • predictLocators: Stable Labels🔒 elite
  • mcqPlaywright core — quiz bank (4 questions)🔒 standard