You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser/10 Page.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,27 +32,28 @@ Page provides methods to interact with a single tab in a running web browser ins
32
32
|[page.isClosed()](/javascript-api/k6-experimental/browser/page/isclosed/)| Checks if the page has been closed. |
33
33
|[page.isDisabled(selector, [options])](/javascript-api/k6-experimental/browser/page/isdisabled/)| Checks if the element is `disabled`. |
34
34
|[page.isEditable(selector, [options])](/javascript-api/k6-experimental/browser/page/iseditable/)| Checks if the element is `editable`. |
35
+
|[page.isEnabled(selector, [options])](/javascript-api/k6-experimental/browser/page/isenabbled/)| Checks if the element is `enabled`. |
36
+
|[page.isHidden(selector, [options])](/javascript-api/k6-experimental/browser/page/ishidden/)| Checks if the element is `hidden`. |
37
+
|[page.isVisible(selector, [options])](/javascript-api/k6-experimental/browser/page/isvisible/)| Checks if the element is `visible`. |
38
+
|[page.keyboard()](/javascript-api/k6-experimental/browser/page/keyboard/)| Returns the [Keyboard](javascript-api/k6-experimental/browser/keyboard/) instance to interact with a virtual keyboard on the page. |
39
+
|[page.locator(selector)](/javascript-api/k6-experimental/browser/page/locator/)| Returns an element [Locator](/javascript-api/k6-experimental/browser/locator/). |
40
+
|[page.mainFrame()](/javascript-api/k6-experimental/browser/page/mainframe/)| Returns the page's main frame. |
41
+
|[page.mouse()](/javascript-api/k6-experimental/browser/page/mouse/)| Returns the [Mouse](javascript-api/k6-experimental/browser/mouse/) instance to interact with a virtual mouse on the page. |
42
+
|[page.opener()](/javascript-api/k6-experimental/browser/page/opener/)| Returns the page that opened the current page. |
43
+
|[page.press(selector, key, [options])](/javascript-api/k6-experimental/browser/page/press/)| Focuses the element, and then uses `keyboard.down(key)` and `keyboard.up(key)`. |
44
+
|[page.opener([options])](/javascript-api/k6-experimental/browser/page/reload/)| Reloads the current page. |
45
+
|[page.screenshot([options])](/javascript-api/k6-experimental/browser/page/screenshot/)| Returns the buffer with the captured screenshot from the browser. |
46
+
|[page.selectOption(selector, values, [options])](/javascript-api/k6-experimental/browser/page/selectoption/)| Selects one or more options which match the values from a `<select>` element. |
47
+
|[page.setContent(html, [options])](/javascript-api/k6-experimental/browser/page/setcontent/)| Sets the supplied html string to the current page. |
48
+
|[page.setDefaultNavigationTimeout(timeout)](/javascript-api/k6-experimental/browser/page/setdefaultnavigationtimeout/)| Changes the navigation timeout for [page.goto(url, [options])](/javascript-api/k6-experimental/browser/page/goto/), [page.reload([options])](/javascript-api/k6-experimental/browser/page/reload/), [page.setContent(html, [options])](/javascript-api/k6-experimental/browser/page/setcontent/), and [page.waitForNavigation([options])](/javascript-api/k6-experimental/browser/page/waitfornavigation/)|
49
+
|[page.setDefaultTimeout(timeout)](/javascript-api/k6-experimental/browser/page/setdefaulttimeout/)| Changes the timeout for all the methods accepting a `timeout` option. |
| [page.locator(selector\[, options\])](/javascript-api/k6-experimental/browser/locator/) | - | Creates and returns a new page `locator` given a selector with strict mode on. The strict mode only allows selecting a single matching element, and will throw an error if multiple matches are found. |
| 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)](javascript-api/k6-experimental/browser/browsercontext/setdefaultnavigationtimeout/), [browserContext.setDefaultTimeout(timeout)](javascript-api/k6-experimental/browser/browsercontext/setdefaulttimeout/), `page.setDefaultNavigationTimeout(timeout)` or `page.setDefaultTimeout(timeout)` methods. Setting the value to `0` will disable the timeout. |
17
+
| 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)](/javascript-api/k6-experimental/browser/browsercontext/setdefaultnavigationtimeout/), [browserContext.setDefaultTimeout(timeout)](/javascript-api/k6-experimental/browser/browsercontext/setdefaulttimeout/), [page.setDefaultNavigationTimeout(timeout)](/javascript-api/k6-experimental/browser/page/setdefaultnavigationtimeout/) or [page.setDefaultTimeout(timeout)](/javascript-api/k6-experimental/browser/page/setdefaulttimeout/) methods. Setting the value to `0` will disable the timeout. |
18
18
| options.waitUntil | string |`load`| When to consider operation to have succeeded. See [Events](#events) for more details. |
| selector | string |`''`| A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. |
19
+
| options | object |`null`||
20
+
| options.strict | boolean|`false`| When `true`, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception. |
21
+
| options.timeout | number |`30000`| Maximum time in milliseconds. Pass `0` to disable the timeout. Default is overridden by the `setDefaultTimeout` option on [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) or [Page](/javascript-api/k6-experimental/browser/page/). |
| selector | string |`''`| A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. |
19
+
| options | object |`null`||
20
+
| options.strict | boolean|`false`| When `true`, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception. |
21
+
| options.timeout | number |`30000`| Maximum time in milliseconds. Pass `0` to disable the timeout. Default is overridden by the `setDefaultTimeout` option on [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) or [Page](/javascript-api/k6-experimental/browser/page/). |
| selector | string |`''`| A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. |
19
+
| options | object |`null`||
20
+
| options.strict | boolean|`false`| When `true`, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception. |
21
+
| options.timeout | number |`30000`| Maximum time in milliseconds. Pass `0` to disable the timeout. Default is overridden by the `setDefaultTimeout` option on [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) or [Page](/javascript-api/k6-experimental/browser/page/). |
The method returns an element [Locator](/javascript-api/k6-experimental/browser/locator/). Locators resolve to the element when the action takes place, which means locators can span over navigations where the underlying dom changes.
0 commit comments