Skip to main content

Function: byRole()

byRole(value, relative): CssLocator

Defined in: packages/core/src/locators/byRole.ts:23

Locate elements by their ARIA role attribute.

Parameters​

value​

string

The role value to match.

relative​

LocatorRelativePosition = 'Descendant'

Relative position of the locator. Defaults to 'Descendant'.

Returns​

CssLocator

Example​

const dialog = byRole('dialog');