Evidence
Pointing at the element
Most reports are about one thing on the page. pickElement() turns the cursor
into a crosshair, highlights whatever is under it, and resolves with a
description of the element the reporter clicks: a short CSS selector, the tag,
the visible text, the position on the page, and the useful attributes (id,
name, role, aria-label, href, every data-*). Escape cancels. The click
is swallowed, so picking a button does not also press it.
{
"selector": "form#checkout > button:nth-of-type(2)",
"tag": "button",
"text": "Save order",
"rect": { "x": 912, "y": 640, "width": 118, "height": 36 },
"attributes": { "type": "submit", "data-testid": "save-order" }
}The selector prefers an id or a data-testid on the element or an ancestor,
then an aria-label (which ends the walk only once it is unique, since every
row's "Delete" button shares one), then falls back to tag:nth-of-type steps,
at most five deep and never past 200 characters. An id, test id or label longer
than 64 characters is skipped as generated. It is meant to be read by a person
or an agent, and to land on the right file — not to be a stable locator for a
test suite.
To attach a picture of the element as well, see Choosing what the picture shows.