Skip to main content

Recipes

Built-in recipe commands for common browser automation patterns. Recipes combine multiple BAP commands into single, parameterized operations.

login

Automate a login flow with one command.
bap recipe login https://app.example.com/login --user=admin@example.com --pass=secret123
url
string
required
The login page URL.
--user
string
required
Username or email to fill.
--pass
string
required
Password to fill.
The recipe navigates to the URL, observes the page to find username/password fields, fills them, and clicks the submit button.

fill-form

Fill a form using data from a JSON file.
bap recipe fill-form https://app.example.com/signup --data=form-data.json
url
string
required
The page URL containing the form.
--data
string
required
Path to a JSON file mapping field labels or selectors to values.
Example form-data.json:
{
  "Name": "Jane Doe",
  "Email": "jane@example.com",
  "Country": "Canada",
  "I agree to the terms": true
}

wait-for

Wait for an element to appear on the page.
bap recipe wait-for role:button:"Continue"
bap recipe wait-for text:"Order confirmed" --timeout=30000
selector
string
required
Selector for the element to wait for.
--timeout
number
default:"10000"
Maximum wait time in milliseconds.
Use wait-for after actions that trigger asynchronous page updates, like form submissions or API calls that update the DOM.