Skip to content

Element Exists

Type: page-element-exists  ·  Package: Browser v1.0.0  ·  Output: boolean

Checks whether an element exists and is visible on the page, and returns true or false. Unlike other activities, it does not fail if the element is not there: it simply returns false. It’s the way to handle pages that sometimes show something and sometimes don’t — an error message, a cookie banner, a search result.

Search for the element by its selector. By default (timeout = 0) it does an immediate check. If you enter a larger timeout, wait until that time for the item to appear before returning false. The result typically feeds an If.

ParameterEditorDescription
selectorselectorThe item to check.
ParameterEditorDescription
pagesessionThe page session. Omit it inside a body; outside, pass = page.
timeoutnumberMaximum in ms to wait for it to appear. 0 = immediate check (default).

Returns a boolean: true if it exists and is visible, false if not.

Close a cookie banner only if it appears:

Page Element Exists selector = (#banner-cookies) → output: hayBanner
If condition = = hayBanner
└─ then:
Page Click selector = (#aceptar-cookies)
  • Wait For — wait (and demand) that an item appears.
  • If — branch based on the result.