Software Testing / Learning brief

Tom teaches the robot a new word

What this means in plain language

Leo's team marks test elements with a different attribute name. Tom changes one setting and then wonders whether to build his own finder. A helper robot shows why the rename comes first and the new word last.

Understand the full idea, step by step

A helper robot knows the words door, window and lamp. You ask for a lamp and it brings one. One day you want your aunt's blue lamp. You can teach the robot a new word. Or you can tell it the family name for a thing it already knows.

Tom has this choice in the Daily List tests. Playwright is a free tool that drives a real web browser, and it lets him do both.

PLAIN WORDS · 1 in this section
playwright
a free Microsoft tool that drives a browser for tests

Evidence & review

REVIEWED 2026-10-18

The date on this lesson is when it went up on Payments Signal, not when its material was written — most of these were brought across from an earlier catalogue in a single run, which is why so many of them share a date. What the lesson says about the world is dated by the review above and by the sources below it.

Test id attributes and custom selector engines in Playwright as taught in this academy, with an invented app and invented people. Playwright changes often, so check the current reference.

What this brief simplifies: Fiction labelled SYNTHETIC / TRAINING ONLY. Sources were seen only as search excerpts, and no real run was made. The robot is a teaching picture.

Sources for this brief — 5 sources
  1. Market practice

    Extensibility (Playwright documentation) ↗ — Microsoft (Playwright) · selectors.register adds a custom selector engine before any page is created; an engine has query and queryAll methods that work from a root element; the name may use letters, digits and underscores and becomes the prefix; the contentScript option runs the engine apart from the page scripts (search excerpt, page not opened)

    Historical extensibility-guide reference. Current teaching uses the actual Selectors API and pinned 1.65 validation/parser/client sources: implementation accepts hyphens in engine names and propagates registration to known contexts. Register early for predictable setup; contentScript isolates script execution while querying the same DOM, not a general security boundary. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Locators (Playwright documentation) ↗ — Microsoft (Playwright) · The test id attribute is data-testid by default and can be changed with testIdAttribute; role locators are preferred and test ids are a resilient fallback (search excerpt, page not opened)

    Says role locators are the preferred choice because they match how users and assistive tools see the page, label locators suit form fields, text locators suit non-interactive elements, and test ids are the most resilient fallback when role or text cannot be used. Says the test id attribute is data-testid by default and can be changed with testIdAttribute. Says a matching locator that resolves to more than one element throws in strict mode for actions, and that first, last and nth are not recommended. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

  3. Market practice

    Selectors class reference (Playwright documentation) ↗ — Microsoft (Playwright) · The Selectors class has register and setTestIdAttribute (search excerpt, page not opened)

    Selectors API: register/query/queryAll, test ID attributes and contentScript. Documentation name vocabulary is narrower than inspected Playwright 1.65 registration/parser, which also accepts hyphens. Register early for predictable setup; inspected implementation propagates registration to existing contexts. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: register and setTestIdAttribute. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

  4. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Prefer user-facing locators over CSS or XPath (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).

  5. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.

Learn this properly

START HERECustom selector engines and test id attributesChange which attribute getByTestId reads, and learn how a custom selector engine is built and registered, and why it is the last tool in the box.Opens at L0 Explain simply · about 18 min

Related briefs