Software Testing / Learning brief

Tom whispers to the page

What this means in plain language

Tom needs a fact that no click can show, and a way to set the page before it starts. A stage and a whispered note show how evaluate and init scripts work, and why clicks stay with locators.

Understand the full idea, step by step

A play is on. You cannot walk on stage, but you can whisper a note to an actor. Tell me what is on the table. The actor looks and answers.

Tom has the same need at Daily List, a to-do list app. He wants a fact that no click shows, such as how far the task list is scrolled. Playwright, a free tool that drives a real web browser, lets him whisper a note to the page.

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.

Running JavaScript in the page with 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 stage is a teaching picture.

Sources for this brief — 5 sources
  1. Market practice

    Handles (Playwright documentation) ↗ — Microsoft (Playwright) · A JSHandle points to any object in the page and an ElementHandle to a page element; ElementHandle is discouraged except in rare cases and locators are advised for actions and assertions; handles are released when the page navigates (search excerpt, page not opened)

    Says a JSHandle points to any object in the page and an ElementHandle points to a page element; ElementHandle is discouraged except in rare cases, and locators are advised for actions and assertions; handles are released when the page navigates and a handle keeps its object alive until disposed. 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.

  2. Market practice

    Page (Playwright documentation) ↗ — Microsoft (Playwright) · page.evaluate runs a function in the page and gives back a value, evaluateHandle gives back a handle, addInitScript runs before the page scripts, and exposeFunction adds a function to window that survives navigations (search excerpt, page not opened)

    Covers page.routeFromHAR() with its update and notFound options, the popup event, page.waitForLoadState(), page.close() with runBeforeUnload, and page.bringToFront(). Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · 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.

  3. Market practice

    Locator class reference (Playwright documentation) ↗ — Microsoft (Playwright) · A locator has its own evaluate and evaluateAll methods (search excerpt, page not opened)

    Reference for the Locator class: filter with hasText, hasNotText, has and hasNot (text matching is case-insensitive substring for a string), and, or, locator, nth, first, last, count and all. Says the inner locator of has is matched starting from the outer one. Says hasNot and hasNotText arrived in version 1.33 and and() in version 1.34. Vendor documentation for one tool. Practitioner guidance, not a standard. · 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.

  4. Market practice

    Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Playwright waits for an element to be ready before it acts on it (search excerpt, page not opened)

    Says Playwright runs actionability checks (visible, stable, enabled, receives events) before an action and fails with a timeout error if they do not pass in time. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · 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.

  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 HERERunning JavaScript in the page: evaluate, handles and init scriptsRun a small piece of code inside the page to read or set something, know what a handle is, and keep clicks and checks on locators.Opens at L0 Explain simply · about 18 min

Related briefs

Tom opens the right page

Tom works small cases. He checks that a notification link opens the right page and that the app follows phone settings. He also checks how app types change tests and what happens when the network changes.

READ BRIEF