Skip to main content

Action Commands

Individual interaction commands for when you need fine-grained control. For multi-step flows, prefer composite actions with bap act.

click

Click an element.
string
required
Element selector. See Selectors below.

fill

Fill an input field. Clears existing content first.
string
required
Element selector targeting the input field.
string
required
The text value to fill.
Use fill for form fields. It clears existing content and sets the value in one step. Use type only when you need character-by-character input (e.g., autocomplete, search-as-you-type).

type

Type text character by character into the focused element. Triggers keydown, keypress, and keyup events for each character.
string
required
The text to type character by character.
type does not clear existing content. It appends to whatever is already in the field. For form fields, prefer fill.

press

Press a keyboard key or shortcut.
string
required
Key name (e.g., Enter, Tab, Escape, ArrowDown, Control+a).

select

Select an option from a dropdown.
string
required
Selector targeting the <select> element.
string
required
The option value or visible text to select.

check / uncheck

Toggle checkboxes.
string
required
Selector targeting the checkbox element.

hover

Hover over an element. Useful for triggering hover menus or tooltips.
string
required
Selector targeting the element to hover over.

scroll

Scroll the page or scroll an element into view.
string
default:"down"
Scroll direction: up, down, left, right.
number
default:"300"
Number of pixels to scroll.
string
When provided, scrolls the element into view instead of scrolling the page.

Selectors

All action commands accept the same selector formats:
Never copy CSS selectors from browser DevTools. They break across deployments. Prefer semantic selectors (role:, label:, text:) that survive DOM changes.