Skip to content

Wait For

Type: page-wait-for  ·  Package: Browser v1.0.0

Pause the flow until an element reaches the state you indicate. It’s the essential tool to make your web automations reliable: instead of guessing with a fixed Delay how long a page takes, you wait exactly for the element you need to be ready.

Look at the item indicated by the selector and wait until it reaches the requested state (or until timeout is exhausted, in which case it fails). As soon as it is fulfilled, the flow continues immediately — neither before nor later.

ParameterEditorDescription
selectorselectorThe element to wait for.
ParameterEditorDescription
pagesessionThe page session. Omit it inside a body; outside, pass = page.
statelistState to expect: visible (def.) · hidden (hidden) · attached (present in the HTML) · detached (no longer present).
timeoutnumberMaximum in ms to wait. By default 30000.
EstadoWait for the element…
visibleAppear and be visible (most used)
hiddenIt hides (e.g. a loading spinner that disappears)
attachedExists in the HTML, even if it is not visible
detachedStop existing in the HTML

Wait for the dashboard to load after logging in, and for the spinner to disappear:

Page Click selector = (#entrar)
Page Wait For selector = (.spinner-carga) state = hidden // esperar a que termine de cargar
Page Wait For selector = (.dashboard) state = visible // y a que aparezca el contenido
  • Element Exists — check for presence without failing (returns true/false).
  • Navigate — its parameter waitUntil controls the page load wait.
  • Delay — sticky wait (less reliable; use as a last resort).