New Page
New Page
Section titled “New Page”Type: browser-new-page · Package: Browser v1.0.9 · Output: ZoanPageSession
Opens a new tab in a browser that is already open and returns its page session. Use it when you need to work with several pages at once in the same browser: check another section in parallel, compare two pages or keep a list open while you work on another.
How it works
Section titled “How it works”From any page session of the browser, it creates a new tab (optionally navigating to a url and waiting for its load event, up to 30 s) and returns a ZoanPageSession that represents it. Pass that new session as page to the activities that must act on it, and close it with Close Page when you’re done.
- Isolated session: except with
userDataDir, the new tab opens in its own context, like an incognito window: it doesn’t share cookies or the signed-in state of the other tabs. If you need the same signed-in session, open the tab from the website itself with Click andexpectNewTab = true, or navigate in the same tab with Navigate. - With a browser opened with
userDataDir, the tab shares the profile andviewportanduserAgentare ignored. - A
viewportin a format other thanWIDTHxHEIGHTis ignored without an error.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanPageSession | — | Any page session of the browser to open the tab in (from Open Browser, Attach Browser, Switch Page…). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | — | URL to navigate to when the tab opens. Empty: blank tab. |
viewport | string | — | Viewport size as WIDTHxHEIGHT (e.g. 1920x1080). Empty: the window size. |
userAgent | string | — | Overrides the user-agent string the tab sends. |
Output
Section titled “Output”Returns a ZoanPageSession that represents the new tab, tied to the same browser (it also works for Close Browser).
Example
Section titled “Example”Open Browser browser = chrome url = "https://portal.example.com" → output: pageBrowser New Page session = page url = "https://example.com/rates" → output: tasasPage Get Text page = tasas selector = (#tasaDelDia) → output: tasaClose Page page = tasasPage Fill page = page selector = (#tasa) value = tasaCommon errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'session' must be a ZoanPageSession or ZoanBrowserSession. | The variable is empty or doesn’t hold a browser session. Pass the output of Open Browser or another page session. |
Timeout 30000ms exceeded | The url didn’t finish loading in 30 s. Open the tab without url and navigate with Navigate, which supports timeout and waitUntil. |
Related activities
Section titled “Related activities”- Close Page — close the tab when you’re done.
- Switch Page — take a tab the website opened itself.
- Open Browser / Attach Browser — get the browser session.