Back to Puppeteer

Locator.setTimeout() method

website/versioned_docs/version-24.40.0/api/puppeteer.locator.settimeout.md

19.2.2574 B
Original Source

Locator.setTimeout() method

Creates a new locator instance by cloning the current locator and setting the total timeout for the locator actions.

Pass 0 to disable timeout.

Signature

typescript
class Locator {
  setTimeout(timeout: number): Locator<T>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

timeout

</td><td>

number

</td><td> </td></tr> </tbody></table>

Returns:

Locator<T>

Default value:

Page.getDefaultTimeout()