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
|`Promise<Page>`| A Promise that fulfills with a [page](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page) object when the `page` event has been emitted. |
24
24
25
25
### Example
26
26
27
+
This API is useful when you want to wait for the new page to open after clicking on a link that opens in a new tab.
28
+
29
+
<CodeGrouplabels={[]}>
30
+
31
+
```javascript
32
+
import { browser } from'k6/browser';
33
+
34
+
exportconstoptions= {
35
+
scenarios: {
36
+
ui: {
37
+
executor:'shared-iterations',
38
+
options: {
39
+
browser: {
40
+
type:'chromium',
41
+
},
42
+
},
43
+
},
44
+
},
45
+
};
46
+
47
+
exportdefaultasyncfunction () {
48
+
constpage=awaitbrowser.newPage();
49
+
50
+
awaitpage.goto('https://test.k6.io/');
51
+
52
+
awaitpage.keyboard.down('ControlOrMeta');
53
+
54
+
// Open the link in a new tab with the help of the meta key.
0 commit comments