Skip to main content
Version: 22.14.0

Page.locator() method

Creates a locator for the provided function. See Locator for details and supported actions.

Signature:

class Page {
locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>;
}

Parameters

Parameter

Type

Description

func

() => Awaitable<Ret>

Returns:

Locator<Ret>