Skip to main content
Momentic is a managed testing platform for the web. Tests are YAML, executed on a managed runner. A multi-modal step cache stores locator metadata per step and auto-heals in place when the UI changes. AI primitives cover action, assertion, visual diff, and typed extraction. AI providers route with cross-provider failover behind a single managed surface. A dashboard captures run videos, traces, network, heal events, and AI reasoning. Stagehand is an open-source TypeScript library from Browserbase. It adds four AI primitives (act, observe, extract, agent) on top of Playwright. With env: "BROWSERBASE" it adds Browserbase Cache (server-side, on by default) and Browserbase Model Gateway (one Browserbase key routes to OpenAI, Anthropic, Google). It’s a fit for teams that want programmatic TypeScript control with a thin AI layer over Playwright.

Speed and caching

How the multi-modal cache works

A cached step stores more than one way to find the target: where it sits on screen, what it looks like, what text it contains, and the structural and accessibility attributes around it. Which of those signals matters for a given step is inferred from the natural-language description. “The red Cancel button below the Order Summary header” leans on visual and positional signals; “the Submit button in the form” leans on structure and role. When a step replays, the runner checks the stored signals against the live page and runs the action without invoking the LLM when there’s a match. On a miss, the locator agent (auto-heal) re-resolves the original description against the live page, updates the cache entry in place, and the run continues. A heal event is recorded against the run. Stagehand’s Browserbase Cache keys on the page’s accessibility tree, so any background change (a transient banner, a streaming widget, an A/B variant) flips the key even when the target itself hasn’t changed. The Stagehand caching docs recommend page.waitForLoadState("networkidle") before every action to keep the tree stable enough to hit. On miss, Stagehand re-runs the LLM and writes a new entry under the new key; the old entry isn’t reused. Local Cache writes a JSON file under cacheDir; the team owns expiry, ignore rules, and lock contention.

AI primitives and assertions

Momentic step types (see test format)
  • Action: act, click, type, hover, scroll, navigate, dragAndDrop, fileUpload, select, dialog, refresh
  • Assert: assert, assertVisually, checkPageContains, checkElement<...>
  • Extract: extract (typed via JSON schema)
  • Control flow: if/then, modules, parameter inputs
Stagehand assertion pattern
There’s no failure mode beyond a boolean. The team owns thresholds, schema design, and reporter integration.

CI, recovery, and observability

  • Default: quarantined tests run, results report, statuses do not affect exit code.
  • --skip-quarantined: quarantined tests are skipped entirely.
  • --only-quarantined: only quarantined tests run; statuses do affect exit code.

Authoring side-by-side

Same flow, both tools:
Agentic simplified format:
Explicit simplified format (same flow, step-by-step):

A more realistic test

The hello-world above doesn’t exercise the full simplified format surface. A representative checkout regression with module reuse, parameter inputs, typed extraction, and a conditional looks like this:
checkout.test.yaml
The matching module:
../modules/sign-in.module.yaml
Both ship MCP servers for coding agents. The integration shape is different.Momentic’s MCP server runs the agent as a preview-then-commit loop: the agent calls momentic_preview_step to verify a candidate against the live page, then momentic_run_step to commit. Authoring tools let the agent edit a slice of a saved test rather than rewriting the whole file. See the MCP server docs for the full tool surface.Stagehand MCP exposes act, observe, extract, agent against a live page. The agent runs the flow once from memory and either keeps the snippet or rewrites it. There’s no per-step preview / commit loop.

When to pick which

Stagehand is the right call if you already have a TypeScript Playwright test suite you want to keep, you want programmatic control of every step, you’re already on Browserbase, and your AI use cases are narrow (one or two acts sprinkled into mostly-deterministic Playwright code). Momentic is the right call if wall-clock run time matters at scale, you need AI assertions and visual diffs as first-class primitives, selector maintenance is a real recurring cost, and you expect healing, recovery, quarantine, and a managed dashboard built in rather than as bring-your-own components. For the build-it-yourself version of this decision, see Build vs. buy.