A dropdown is now picked the way a person picks from a long list: open it,
type the first letters of the option, add a few arrow keys when that is
shorter, press Enter.
- The plan comes from a new __cloakH helper (typeAheadPlan), shared byte for
byte by Python, JS and .NET. It picks the shortest prefix that matches
exactly one enabled option, so the result does not depend on which row the
open popup highlights. That row cannot be read from the page, and on headed
Linux it can be the one under the OS pointer (#580). Prefixes of the
option's own name win; a neighbour's prefix plus up to 3 arrows is used only
when it is shorter. Runs of one letter ("aa") are avoided because Blink
cycles on them.
- Blink joins letters typed within 1s into one search, so a second
select_option on the same page waits for the previous search to lapse.
- The deadline is checked before every key; on timeout the popup is closed
with Escape and a TimeoutError is raised (#581: timeout= was ignored).
- macOS hosts (no arrow keys in the native popup) type the shortest unique
prefix instead of the whole label.
- Labels with no unique prefix (duplicates) fall back to Home + arrows, or the
full label on macOS.
Measured on headed Linux (Xvfb), humanize defaults: #581's 205-option list
1.5-2s per pick (was 20-30s); 166-country list and #580's page with the OS
pointer parked over the popup, 144/144 correct.
Humanized actions in the Playwright wrappers (Python, JS, .NET) now run through a
single shared engine built on Playwright's own selector engine: full locator support
(roles, chains, filters, frame locators, strict mode), Playwright options honoured,
value inputs operated with real input, persona-aware keys, and errors instead of
silent fallbacks. Puppeteer: frame-scoped actions, button/count, Shift on typos.
Follow-ups: macOS dropdowns via type-ahead, nested same-box element handles,
stale handles fail fast, CI fails on a missing test binary.