Skip to content

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.

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 and expectNewTab = true, or navigate in the same tab with Navigate.
  • With a browser opened with userDataDir, the tab shares the profile and viewport and userAgent are ignored.
  • A viewport in a format other than WIDTHxHEIGHT is ignored without an error.
ParameterTypeDefaultDescription
sessionZoanPageSession—Any page session of the browser to open the tab in (from Open Browser, Attach Browser, Switch Page…).
ParameterTypeDefaultDescription
urlstring—URL to navigate to when the tab opens. Empty: blank tab.
viewportstring—Viewport size as WIDTHxHEIGHT (e.g. 1920x1080). Empty: the window size.
userAgentstring—Overrides the user-agent string the tab sends.

Returns a ZoanPageSession that represents the new tab, tied to the same browser (it also works for Close Browser).

Open Browser browser = chrome url = "https://portal.example.com" → output: page
Browser New Page session = page url = "https://example.com/rates" → output: tasas
Page Get Text page = tasas selector = (#tasaDelDia) → output: tasa
Close Page page = tasas
Page Fill page = page selector = (#tasa) value = tasa
MessageCause 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 exceededThe url didn’t finish loading in 30 s. Open the tab without url and navigate with Navigate, which supports timeout and waitUntil.