Skip to main content
Page waiting methods for the Puppeteer driver.

waitForSelector

Wait for a selector to appear in the DOM. Upstream docs
selector
string
required
options
PuppeteerWaitForOptions
result
RemotePuppeteerElementHandle | null
Return value
await page.waitForSelector('...');

waitForTimeout

Wait for a timeout.
Deprecated: Use await new Promise(r => setTimeout(r, ms)) instead.
Upstream docs
milliseconds
number
required
await page.waitForTimeout(0);

waitForFunction

Wait for a function to return true. Upstream docs
pageFunction
string
required
options
{ timeout?: number; polling?: number | "raf" }
args
unknown[]
await page.waitForFunction('...');

waitForNetworkIdle

Wait for network to be idle. Upstream docs
options
PuppeteerWaitForNetworkIdleOptions
await page.waitForNetworkIdle();

waitForFrame

Wait for a frame to appear.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Upstream docs
urlOrPredicate
string
required
options
{ timeout?: number }
result
RemotePuppeteerFrame
Return value
await page.waitForFrame('...');

waitForFileChooser

Wait for a file chooser to appear. Upstream docs
options
{ timeout?: number }
result
RemotePuppeteerFileChooser
Return value
await page.waitForFileChooser();

waitForRequest

Wait for a specific request.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Upstream docs
urlOrPredicate
string
required
options
{ timeout?: number }
result
PuppeteerHTTPRequest
Return value
await page.waitForRequest('...');

waitForResponse

Wait for a specific response.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Upstream docs
urlOrPredicate
string
required
options
{ timeout?: number }
result
PuppeteerHTTPResponse
Return value
await page.waitForResponse('...');

waitForDevicePrompt

Wait for a device prompt (e.g., Bluetooth, USB). Upstream docs
options
{ timeout?: number }
result
{ devices: Array<{ name: string; id: string }>; select: (deviceId: string) => Promise<void>; cancel: () => Promise<void> }
Return value
await page.waitForDevicePrompt();