Skip to content

Commit 7a188e7

Browse files
inancgumusschalksnyman
authored andcommitted
Async frame.setContent
1 parent 919e089 commit 7a188e7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: 'setContent(html[, options])'
3+
description: 'Browser module: frame.setContent(html[, options]) method'
4+
---
5+
6+
# setContent(html[, options])
7+
8+
Sets the supplied HTML string to the current frame.
9+
10+
<TableWithNestedRows>
11+
12+
| Parameter | Type | Default | Description |
13+
| ----------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14+
| html | string | `''` | HTML markup to assign to the page. |
15+
| options | object | `null` | |
16+
| options.timeout | number | `30000` | Maximum operation time in milliseconds. Pass `0` to disable the timeout. The default value can be changed via the [browserContext.setDefaultNavigationTimeout(timeout)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext/setdefaultnavigationtimeout/), [browserContext.setDefaultTimeout(timeout)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/browsercontext/setdefaulttimeout/), [page.setDefaultNavigationTimeout(timeout)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page/setdefaultnavigationtimeout/) or [page.setDefaultTimeout(timeout)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page/setdefaulttimeout/) methods. Setting the value to `0` will disable the timeout. |
17+
| options.waitUntil | string | `load` | When to consider operation to have succeeded. See Events for more details. |
18+
19+
</TableWithNestedRows>
20+
21+
### Returns
22+
23+
| Type | Description |
24+
| --------------- | -------------------------------------------------------------------------- |
25+
| `Promise<void>` | A Promise that fulfills when the page has been set with the supplied HTML. |

0 commit comments

Comments
 (0)