Skip to content

Browser

Version: 1.0.10  ·  ID: zoan-packages-browser  ·  Author: Zoan Software

The Browser package automates a web browser the way a person would: it opens Chrome, Edge, Firefox or Chromium, navigates to a page, clicks, fills out forms, reads text and extracts tables. Under the hood it uses Playwright, a modern and robust web automation engine, but you don’t need to know any of that: you work with visual activities.

It is one of the most used packages, because a large share of business systems (ERP, portals, banking, government) are operated from the browser.

Open Browser opens the browser you choose in its browser parameter (or the default browser in the project settings):

ValueBrowserWhere it is looked up
chrome (default)Google Chrome installed on the machineC:\Program Files\Google\Chrome\Application\chrome.exe, the same path under Program Files (x86), or %LOCALAPPDATA%\Google\Chrome\Application\chrome.exe
edgeMicrosoft Edge installed on the machineC:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe or the same path under Program Files
firefoxMozilla Firefox installed on the machineC:\Program Files\Mozilla Firefox\firefox.exe or the same path under Program Files (x86)
chromiumThe Chromium bundled with the packageNothing needs to be installed
  • If nobody chose a browser (neither the activity nor the project) and Chrome is not installed, the bundled Chromium is used automatically. If you pick a browser on purpose and it is missing, the activity fails with a clear message.
  • With executablePath you can point to the exact path of another Chromium-based browser (.exe, .bat or .cmd).
  • Chrome and Edge open with a clean temporary profile (without the person’s cookies) that is deleted on close, with automatic downloads enabled and PDFs set to download instead of opening in the viewer. To use the person’s real profile, set userDataDir.

When you open a browser with Open Browser, you get a page session (type ZoanPageSession): an object that represents that open tab. Every page activity (click, fill, read…) needs to know which tab to act on — that’s the page parameter.

There are two ways to work:

Open Browser (and Attach Browser) have a body sub-flow. Activities placed inside it inherit the session automatically: you don’t need to set the page parameter on any of them. When the body finishes, the browser closes on its own.

Open Browser browser = chrome url = "https://example.com"
└─ body:
Page Fill selector = (#usuario) value = "ana"
Page Click selector = (#entrar)
Page Get Text selector = (.bienvenida) → output: saludo

Option B — With an output variable (explicit control)

Section titled “Option B — With an output variable (explicit control)”

Open Browser stores the session in an output variable (e.g. page). Each activity then receives page = page, and at the end you close it with Close Browser. Useful when the browser must stay open across several sections of the playbook.

Open Browser browser = chrome → output: page
Page Navigate page = page url = "https://example.com"
Page Click page = page selector = (#entrar)
Close Browser session = page

Page activities (page-*) use, in this order:

  1. The session you put in their page parameter.
  2. If it is empty, the page of the Open Browser or Attach Browser body that contains them.
  3. If there is neither, they fail with 'page' must be a ZoanPageSession.

A ZoanPageSession represents one tab and remembers which browser it belongs to, so any page session also works for Close Browser, New Page and Switch Page. You get sessions for other tabs from New Page, from Switch Page and from Click when you turn on expectNewTab (the tab the click opens).

A selector tells the bot which element on the page to use (this button, that field). The recommended way to create them is by pointing with the mouse using UI Discover: Zoan Automation captures a robust reference that combines several strategies (first id, then name, aria-label, text… and CSS/XPath as a last resort), so it survives page changes better. You can also write a CSS selector by hand (#usuario, input[name="email"]).

FormExampleHow it is resolved
Captured selector (the one UI Discover creates)(#usuario) in this documentationTries its attributes from most stable to most fragile: id, data-testid, name, aria-label, placeholder, text or accessible name (aaname), role, the node’s CSS and, as a last resort, the fallback CSS and the XPath. Supports * wildcards, /pattern/ regular expressions, iframe nodes and anchors.
Hand-written text#usuario, input[name="email"], text=Save, xpath=//table//tr[2], #menu >> text=Sign outPassed as-is to the Playwright engine: CSS, text=, xpath= (or a path starting with //) and steps chained with >>.
  • A single element: actions (click, fill, read…) require the selector to point to exactly one element. If it matches several, the activity fails and says how many it found; narrow the selector with an index (idx), an anchor or a more specific attribute. Element Exists and the container of Extract Structured Data take the first one without failing.
  • Attributes that change on their own: ids generated by the page’s framework (mat-input-0, ember123, :r1:…), hashed classes and state classes (active, is-focused…) are used only as a hint when the selector has something stable next to them. That way a recorded selector keeps working even if those values change between runs.
  • With anchors, candidates are evaluated the instant the activity starts: if there are none yet, it fails right away with No elements match the selector, so the anchors cannot be applied. Before it, use Wait For on an element of the same screen that doesn’t use anchors.

You don’t need fixed pauses before each step: activities that act on an element wait on their own until it is ready.

ActivityBefore acting, it waits for the element to…
Click, Check / Uncheckexist, be visible, be stable (not animating), be enabled and not be covered by another element; it scrolls it into view if needed
Fill Fieldexist, be visible, be enabled and be editable
Type Text, Key Press with a selectorexist on the page (then it focuses it)
Hoverexist, be visible, be stable and not be covered by another element
Select Optionexist, be visible and be enabled
Get Text, Get Value, Get Attributeexist on the page
Wait Forreach the requested state (visible, hidden, attached or detached)

How long they wait before failing:

ActivityDefault timeout
Page activities with a timeout parameter (Click, Fill Field, Type Text, Check / Uncheck, Hover, Select Option, Key Press with a selector, Get Text, Get Value, Get Attribute, Wait For, Navigate, Extract Structured Data)The activity’s timeout. Empty, 0 or negative: the timeout to find an element from the project settings; if the project doesn’t set one, 30000 ms.
Element Exists0: immediate check (it doesn’t use the project’s).
Open Browser90000 ms to start the browser and load the url.
Switch Page10000 ms looking for the tab.
Click with expectNewTabnewTabTimeout: 15000 ms waiting for the new tab.
Download File, Wait for Download30000 ms (the request, or for the download to start).
New Page with url, Screenshot of an element, Scroll to an elementNo parameter: 30000 ms.

The delays before and after each action defined in the project settings also apply to the activities of this package.

Click, Fill Field, Type Text, Check / Uncheck, Hover, Select Option and Wait For explain the failure in the message itself, without screenshots or page data:

Click failed: Timeout 30000ms exceeded. … | selector: <button> #guardar | matches: 0 (element not found: the page may not have loaded, the element may be inside an iframe, or the selector is outdated)
matchesWhat it means
0The element isn’t there: the page hadn’t finished loading, it is inside an iframe the selector doesn’t include, or the selector is outdated.
1The element is there, but the action didn’t complete: it is hidden, disabled, covered by another element or out of view.
2 or moreThe selector is ambiguous: add an index or an anchor to disambiguate.

Before starting, the engine also checks the parameters: if a required one is missing, it fails with [page-click] Required parameter 'selector' not found.; if an options parameter has a fixed value outside its list, with [page-wait-for] Invalid value '…' for 'state'. Allowed: visible, hidden, attached, detached.

Every activity in the package fails with a regular playbook error, so you can wrap them in Try / Catch or retry them with Retry.

ActivityTypeOutputWhat it does
Open Browserbrowser-openZoanPageSessionOpens the browser and returns a page session
Attach Browserbrowser-attachZoanPageSessionPicks up a page session you already have in a variable
New Pagebrowser-new-pageZoanPageSessionOpens a new tab in the same browser
Switch Pagebrowser-switch-pageZoanPageSessionTakes an already open tab by URL, title or position
Close Pagepage-close—Closes a tab
Close Browserbrowser-close—Closes the browser with all its tabs
ActivityTypeOutputWhat it does
Navigatepage-navigate—Goes to a URL
Clickpage-clickZoanPageSessionClicks an element; with expectNewTab, returns the tab it opens
Fill Fieldpage-fill—Writes a value into a field (fast)
Type Textpage-type—Types text character by character
Select Optionpage-select—Chooses an option in a <select>
Check / Uncheckpage-check—Checks/unchecks a checkbox or radio button
Hoverpage-hover—Moves the mouse over an element
Key Presspage-key-press—Sends a key or key combination
Scrollpage-scroll—Scrolls the page or brings an element into view
ActivityTypeOutputWhat it does
Get Textpage-get-textstringVisible text of an element
Get Valuepage-get-valuestringValue of an input/select/textarea
Get Attributepage-get-attributestringValue of an HTML attribute
Element Existspage-element-existsboolDoes the element exist and is it visible?
Extract Structured Datapage-extract-tableDataTableExtracts an HTML table, or any visual grid, into a DataTable
ActivityTypeOutputWhat it does
Wait Forpage-wait-for—Waits for an element to reach a state
Wait for Downloadpage-wait-for-downloadstringWaits for a download to finish
Download Filepage-download-filestringDownloads a file from a URL using the browser session
Screenshotpage-screenshotstringSaves a screenshot to a file
Evaluate JSpage-evaluateobjectRuns JavaScript on the page
Open Browser browser = chrome url = "https://portal.example.com"
└─ body:
Page Wait For selector = (#usuario) state = visible
Page Fill selector = (#usuario) value = credential("portal")["user"]
Page Fill selector = (#clave) value = credential("portal")["password"]
Page Click selector = (#entrar)
Page Wait For selector = (.dashboard) state = visible
Extract Structured Data selector = (#tablaMovimientos) → output: movimientos