Skip to content

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.

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 page empty inside the body of Open Browser or Attach Browser, it closes that body’s tab: the following activities in the body will no longer have a page.
  • After closing it, that session no longer works for page activities.

None.

ParameterTypeDefaultDescription
pageZoanPageSession—The tab to close, e.g. detalle. Empty: the page of the body that contains the activity.

This activity does not return a value.

Open a secondary tab, use it and close it:

Browser New Page session = page url = "https://example.com/help" → output: ayuda
Page Get Text page = ayuda selector = (.version) → output: version
Close Page page = ayuda
Log message = "Published version: " + version
MessageCause and fix
'page' must be a ZoanPageSession.page is empty outside a body, or the variable doesn’t hold a page session.