2022-08-06 14:49:20 +00:00
---
sidebar_label: Page.waitForFrame
---
# Page.waitForFrame() method
2022-10-24 14:31:12 +00:00
#### Signature:
2022-08-06 14:49:20 +00:00
```typescript
class Page {
waitForFrame(
urlOrPredicate: string | ((frame: Frame) => boolean | Promise< boolean > ),
options?: {
timeout?: number;
}
): Promise< Frame > ;
}
```
## Parameters
2023-03-06 13:53:56 +00:00
| Parameter | Type | Description |
| -------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------- |
| urlOrPredicate | string \| ((frame: [Frame ](./puppeteer.frame.md )) => boolean \| Promise< boolean> ) | A URL or predicate to wait for. |
| options | { timeout?: number; } | _(Optional)_ Optional waiting parameters |
2022-08-06 14:49:20 +00:00
**Returns:**
Promise< [Frame](./puppeteer.frame.md)>
Promise which resolves to the matched frame.
## Remarks
Optional Parameter have:
- `timeout` : Maximum wait time in milliseconds, defaults to `30` seconds, pass `0` to disable the timeout. The default value can be changed by using the [Page.setDefaultTimeout() ](./puppeteer.page.setdefaulttimeout.md ) method.
## Example
```ts
const frame = await page.waitForFrame(async frame => {
return frame.name() === 'Test';
});
```