Tricky widgets: date pickers, tables, drag and drop and rich text
Handle four awkward parts of a page: fill or pick a date, find a row in a table, drag one item onto another, and type into a text box that formats.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: hard-to-grip door handles of different shapes. Most doors have a round knob, and your hand knows what to do. Then you meet a lever, a pull bar, a sliding latch and a key-card reader. The hand is the same. You learn each grip once, and after that the door is easy.
Tom tests Daily List, a to-do list app. Plain boxes and buttons are the round knobs. Tom has them down. Now he meets four awkward ones.
What it is: Playwright is a free tool, made by Microsoft, that drives real web browsers from test code. This topic is about four widgets that need more care than a box or a button. A widget is a ready-made piece of a page, such as a calendar or a table. The four are a (the small calendar for a due date), a table (the task list), (reorder by dragging) and a rich text field (a notes box that can make text bold). Playwright has the pieces for all four. The skill is knowing which piece fits which widget.
Why it matters: these four break simple fill-and-click scripts. A test that clicks the wrong "15", deletes the wrong row, or drops to the wrong place gives a false failure, or worse, a . A steady pattern for each widget keeps Tom from pasting fragile workarounds that fail on the next redesign.
The picture has limits. A door handle is fixed, but a widget is code, and two date pickers on two sites can differ a lot. Tom looks at each one before he picks a grip.
Kept simple: this lesson gives common grips. The search found little official guidance on date pickers and tables, so some advice here is common practice.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 5 in this section
- latch
- a switch that stays set until reset
- playwright
- a free Microsoft tool that drives a browser for tests
- widgets
- small page parts people use, such as a date picker
- reorder
- put into a different order
- workarounds
- small tricks used to get round a weakness
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Learning one reliable way to work each awkward part of a page: a , a table, a drag and a rich text box.
- Look
- Pick the call
- Do it
- Check the result
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| A new door handle | A new kind of widget |
| Learning the grip once | Learning the working call for that widget |
| A key-card reader | A custom calendar |
| A sliding latch | A drag and drop |
WHERE THIS PICTURE STOPS
- A handle is fixed, but a widget is code and two sites may build it in different ways.
- A hand learns a grip by feel, and a test learns it by looking at the real page.
- Doors rarely change their handle, while pages change their widgets with a new release.
HOOK
Look at the handle, then pick the grip.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
Before a , a table, or a rich text field, look at the real page first, then pick the grip.
| In the trick | What it stands for |
|---|---|
| date picker | the small calendar for a due date |
| drag and drop | reorders the list |
| rich text | a notes box |
A widget changes with a new release, so the working call can go stale.
TELL A FRIEND
Each awkward widget is a door handle of its own shape. Tom learns one working grip for each and checks the result as a user would.
OFTEN MIXED UP WITH Frames, windows, pop-ups and uploads in UI checks. The earlier lesson covers frames, windows and popups, which are other parts of a page that need a special approach. This lesson covers four more awkward parts.
Sources & standards — 4 sources
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · fill works on text boxes and on contenteditable elements; selectOption is for select elements; dragTo presses the mouse on the source and releases it on the target, and a page that relies on the dragover event may need at least two mouse moves in a manual drag (search excerpt, page not opened)
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.
- Market practice
Locator class reference (Playwright documentation) ↗ — Microsoft (Playwright) · A locator can be narrowed with filter and hasText; text matching with a string is a case-insensitive substring match (search excerpt, page not opened)
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.
- Market practice
Assertions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
PRACTISE AND KEEP
Sources for this topic — 4 sources
- Market practice
Actions (Playwright documentation) ↗ — Microsoft (Playwright) · fill works on text boxes and on contenteditable elements; selectOption is for select elements; dragTo presses the mouse on the source and releases it on the target, and a page that relies on the dragover event may need at least two mouse moves in a manual drag (search excerpt, page not opened)
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.
- Market practice
Locator class reference (Playwright documentation) ↗ — Microsoft (Playwright) · A locator can be narrowed with filter and hasText; text matching with a string is a case-insensitive substring match (search excerpt, page not opened)
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.
- Market practice
Assertions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.