Action Commands
Individual interaction commands for when you need fine-grained control. For multi-step flows, prefer composite actions withbap act.
click
Click an element.fill
Fill an input field. Clears existing content first.Element selector targeting the input field.
The text value to fill.
type
Type text character by character into the focused element. Triggerskeydown, keypress, and keyup events for each character.
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.Key name (e.g.,
Enter, Tab, Escape, ArrowDown, Control+a).select
Select an option from a dropdown.Selector targeting the
<select> element.The option value or visible text to select.
check / uncheck
Toggle checkboxes.Selector targeting the checkbox element.
hover
Hover over an element. Useful for triggering hover menus or tooltips.Selector targeting the element to hover over.
scroll
Scroll the page or scroll an element into view.Scroll direction:
up, down, left, right.Number of pixels to scroll.
When provided, scrolls the element into view instead of scrolling the page.
Selectors
All action commands accept the same selector formats:| Selector | Example | When to use |
|---|---|---|
e<N> | e15 | From snapshot refs (playwright-cli compatible) |
@<ref> | @ep44e3j | Stable ref from bap observe |
role:<role>:"<name>" | role:button:"Submit" | By ARIA role and name (recommended) |
text:"<content>" | text:"Sign in" | By visible text |
label:"<text>" | label:"Email" | Form fields by label |
placeholder:"<text>" | placeholder:"Search..." | By placeholder text |
testid:"<id>" | testid:"submit-btn" | By data-testid |
css:<selector> | css:.btn-primary | CSS selector (last resort) |
xpath:<path> | xpath://button | XPath selector (last resort) |
coords:<x>,<y> | coords:100,200 | By page coordinates |