Skip to main content

Function: byName()

byName(value, relative?): PartLocator

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

Locate elements using the value of their name attribute.

Parameters​

value​

string

Value of the name attribute to match.

relative?​

LocatorRelativePosition = 'Descendant'

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

Returns​

PartLocator

Example​

const searchBox = byName('search');