Skip to navigation

Target by element (detailed)

Element to annotate. Mirrors the element-finding fields used elsewhere. On app surfaces only the natively-mappable fields are supported (elementText, elementId, elementTestId, elementAria); selector, elementClass, and elementAttribute have no native equivalent.

Referenced In

Fields

FieldTypeDescriptionDefault
selectorstringOptional. Selector of the element to annotate. Browser surfaces only.—
elementTextstringOptional. Display text of the element to annotate. Supports exact match or regex pattern using /pattern/ syntax.—
elementIdstringOptional. ID attribute of the element to annotate. Supports exact match or regex pattern using /pattern/ syntax.—
elementTestIdstringOptional. data-testid attribute of the element to annotate. Supports exact match or regex pattern using /pattern/ syntax.—
elementClassone of:
- string
- array of string
Optional. Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes. Browser surfaces only.—
elementAttributeobjectOptional. Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence.—
elementAriastringOptional. Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax.—
timeoutintegerOptional. Max duration in milliseconds to wait for the element to exist.5000

Examples

{
"selector": "example",
"elementText": "example",
"elementId": "example",
"elementTestId": "example",
"elementClass": "example",
"elementAttribute": {},
"elementAria": "example",
"timeout": 5000
}