Skip to main content
Locator methods for the Puppeteer driver.

Actions

click

Clicks the located element. Upstream docs
options
Readonly<PuppeteerLocatorClickOptions>
await locator.click();

fill

Fills out the input identified by the locator.
The type of the input is determined at runtime and the appropriate fill-out method is chosen based on the type. contenteditable, select, textarea and input elements are supported.
Upstream docs
value
string
required
options
Readonly<PuppeteerActionOptions>
await locator.fill('...');

hover

Hovers over the located element. Upstream docs
options
Readonly<PuppeteerActionOptions>
await locator.hover();

scroll

Scrolls the located element. Upstream docs
options
Readonly<PuppeteerLocatorScrollOptions>
await locator.scroll();

Queries

filter

Creates an expectation that is evaluated against located values.
If the expectations do not match, then the locator will retry. For RPC, the predicate function is serialized as a string.
Upstream docs
predicate
LocatorPredicate<T, S> | string
required
result
RemotePuppeteerLocator<S>
Return value
await locator.filter(/* LocatorPredicate<T, S> | string */);

Waiting

wait

Waits for the locator to get the serialized value from the page.
Note this requires the value to be JSON-serializable. If a mapper was applied via map(), returns the mapped value.
Upstream docs
options
Readonly<PuppeteerActionOptions>
result
T
Return value
await locator.wait();

waitHandle

Waits for the locator to get a handle from the page. Upstream docs
options
Readonly<PuppeteerActionOptions>
result
RemotePuppeteerElementHandle
Return value
await locator.waitHandle();

Other

map

Maps the locator using the provided mapper function.
For RPC, the mapper function is serialized as a string. The result is returned when wait() is called.
Upstream docs
mapper
LocatorMapper<T, S> | string
required
result
RemotePuppeteerLocator<S>
Return value
await locator.map(/* LocatorMapper<T, S> | string */);