puppeteer/website/versioned_docs/version-20.6.0/api/puppeteer.frame.waitfortimeout.md
release-please[bot] d89072a368
chore: release main (#10298)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2023-06-12 08:11:43 +00:00

1006 B

sidebar_label
Frame.waitForTimeout

Frame.waitForTimeout() method

Warning: This API is now obsolete.

Replace with new Promise(r => setTimeout(r, milliseconds));.

Causes your script to wait for the given number of milliseconds.

Signature:

class Frame {
  waitForTimeout(milliseconds: number): Promise<void>;
}

Parameters

Parameter Type Description
milliseconds number the number of milliseconds to wait.

Returns:

Promise<void>

Remarks

It's generally recommended to not wait for a number of seconds, but instead use Frame.waitForSelector(), Frame.waitForXPath() or Frame.waitForFunction() to wait for exactly the conditions you want.

Example

Wait for 1 second:

await frame.waitForTimeout(1000);