Skip to content

Session Actions

This page defines all of the built in session scoped actions.

$

Selects a single element using the provided CSS selector and scopes all nested actions to that element. Any nested evaluators or actions will operate relative to this selection.

  • selector: The CSS selector. Can be a static string or expression.
$ "#search-input" {
type "Tadpole HQ"
mouse.press "Enter"
}

Selects all elements matching the provided CSS selector. This creates a collection context.

  • selector: The CSS selector. Can be a static string or expression.
$$ ".result-card" {
extract "results" {
title { text }
link { attr "href" }
}
}

Clicks on the active element. It uses a natural movement (bezier curve) to hover the mouse over the element and optionally delay before clicking the target.

  • delay: The delay between hovering and clicking the target. Can be a static number or expression.
  • mouseclick.*: Prefixed options. See mouse.click options
  • hover.*: Prefixed options. See hover options
$ "#submit-button" {
click delay="=gauss(0.5, 0.25)"
}

Extracts data from the current element context into a structured record (JSON). Each child node of extract defines a key in the resulting object and the evaluator(s) used to fetch its value.

  • path: The target key or dot-delimited path (e.g., user.profile) where the record will be stored in the global state. Supports static strings or expressions.

The name of each child node becomes a key in the output record. The children of these nodes are evaluators because we need to produce a value.

$$ ".product-card" {
extract "products" {
title { text }
price {
$ ".amount"
text
}
details {
attr "data-info"
}
}
}
// Output: {"products": [{"title": "...", "price": "...", "details": "..."}, ...]}
$ ".header" {
extract "metadata.page" {
title { text }
url { attr "href" }
}
}
// Output {"metadata": {"page": {"title": "...", "url": "..."}}}

Iterates over a collection of elements selected by a parent $$ block. This action is required when you need to perform individual interactions (like click or hover) on every item in a list.

$$ ".result-item" {
for_each {
$ "button.expand" { click }
}
}

Uses a combination of an ease-out function to scroll and a bezier curve to move the mouse over the active element.

Navigates the current browser tab to a specified URL.

  • url: The url to navigate to. Can be a static string or expression.
  • wait_until: The event to wait for after navigating (load or domcontentloaded). Defaults to load.
  • timeout: The timeout (in ms) for the wait_until event to fire. Defaults to 5000. Can be a static number or expression.

Clicks on the active element and types in the provided text.

It uses hover internally so it uses the same combination of an ease-out function to scroll and a bezier curve to move the mouse.

  • text: The text to type. Can be a static string or expression.
  • delay: The delay between clicking the target and typing. Can be a static number or expression.
  • click.*: Prefixed options. See click options
  • keyboardtype.*: Prefixed options. See keyboard.type options