Skip to content

Commit 2ba2508

Browse files
ankur22inancgumus
authored andcommitted
Update newPage to reflect 1-to-1 change
The description on browser.newPage needs to reflect the new change where only one browserContext can be open at any given time per browser. We need to notify the user how they can work with this new behaviour.
1 parent 356c2e4 commit 2ba2508

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser/newpage--options--.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ title: 'newPage([options])'
33
excerpt: 'Browser module: newPage method'
44
---
55

6-
Creates a new [Page](/javascript-api/k6-experimental/browser/page/) in a new [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) and returns the page. You do not need to create a new `BrowserContext` prior to using `newPage`.
6+
Creates and returns a new [Page](/javascript-api/k6-experimental/browser/page/) in a new [BrowserContext](/javascript-api/k6-experimental/browser/browsercontext/) if a `BrowserContext` hasn't already been initialized for the [Browser](/javascript-api/k6-experimental/browser). If a `BrowserContext` has already been initialized an error is thrown.
7+
8+
<Blockquote mod="note" title="">
9+
10+
A 1-to-1 mapping between [Browser](/javascript-api/k6-experimental/browser) and `BrowserContext` means you cannot run `BrowserContexts` concurrently. Due to this restriction, if one already exists, it must be [retrieved](/javascript-api/k6-experimental/browser/context) and [close](/javascript-api/k6-experimental/browser/browsercontext/close)d first before creating a new one.
11+
12+
</Blockquote>
713

814
<TableWithNestedRows>
915

0 commit comments

Comments
 (0)