Close Page
Close Page
Section titled “Close Page”Type: page-close · Package: Browser v1.0.9
Closes one tab (page) of the browser, leaving the rest of the browser open. It’s used together with New Page, Switch Page or Click with expectNewTab: when you work in extra tabs for a one-off task, you close them with this activity when you’re done, so they don’t pile up.
How it works
Section titled “How it works”It closes the given page session. Unlike Close Browser, it doesn’t close the whole browser — only that tab.
- If the tab was already closed, it does nothing and doesn’t fail.
- If you leave
pageempty inside thebodyof Open Browser or Attach Browser, it closes thatbody’s tab: the following activities in thebodywill no longer have a page. - After closing it, that session no longer works for page activities.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page | ZoanPageSession | — | The tab to close, e.g. detalle. Empty: the page of the body that contains the activity. |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Open a secondary tab, use it and close it:
Browser New Page session = page url = "https://example.com/help" → output: ayudaPage Get Text page = ayuda selector = (.version) → output: versionClose Page page = ayudaLog message = "Published version: " + versionCommon errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'page' must be a ZoanPageSession. | page is empty outside a body, or the variable doesn’t hold a page session. |
Related activities
Section titled “Related activities”- New Page — open the tab you then close.
- Close Browser — close the whole browser.