Browser Automation
Type ID: core.browserAutomation · Kind: Action · Trace: TOOL
Launches a Chromium browser with Playwright, optionally performs a form login (with TOTP support), then runs an ordered list of steps — navigate, fill, click, wait, and extract — returning the collected data.
Credentials
None
Properties
| Property | Key | Type | Required | Default | Possible values | Shown when |
|---|---|---|---|---|---|---|
| URL | url | string | Yes | '' | Start URL (or metrics URL) | Always |
| Timeout (ms) | timeoutMs | number | No | 30000 | Default page timeout in milliseconds | Always |
| Include HTML | includeHtml | boolean | No | false | Include page HTML in output (can be large) | Always |
| Auth Type | auth.type | options | No | none | none — None; form — Form Login | Always |
| Login URL | auth.loginUrl | string | No | '' | URL of the login page | auth.type = form |
| Username Selector | auth.usernameSelector | string | No | #email | CSS selector for the username field | auth.type = form |
| Password Selector | auth.passwordSelector | string | No | #password | CSS selector for the password field | auth.type = form |
| Submit Selector | auth.submitSelector | string | No | button[type=submit] | CSS selector for the submit button | auth.type = form |
| OTP Selector (optional) | auth.otpSelector | string | No | '' | Selector for the OTP input, if the site asks for one | auth.type = form |
| OTP Submit Selector (optional) | auth.otpSubmitSelector | string | No | '' | Selector to submit the OTP | auth.type = form |
| Use TOTP (Authenticator) Automatically | auth.useTotp | boolean | No | false | Generate the OTP from a TOTP secret in credentials | auth.type = form |
| Steps | steps | array | No | [] | Ordered automation steps (see below) | Always |
Steps (nested fields)
Each array entry is a step object with a type and type-specific fields.
| Field | Key | Type | Default | Possible values | Shown when |
|---|---|---|---|---|---|
| Type | type | options | goto | goto — Go To; fill — Fill; click — Click; waitForSelector — Wait For Selector; waitForTimeout — Wait For Timeout; extract — Extract | Always |
| URL | url | string | '' | Target URL | type = goto |
| Wait Until | waitUntil | options | networkidle | load — Load; domcontentloaded — DOM Loaded; networkidle — Network Idle | type = goto |
| Selector | selector | string | '' | CSS selector | type = fill, click, waitForSelector |
| Value | value | string | '' | Value to fill | type = fill |
| Timeout (ms) | timeoutMs | number | 15000 | Wait timeout in milliseconds | type = waitForSelector, waitForTimeout |
| Selectors | selectors | array | [] | Extraction rules (see below) | type = extract |
Extract selectors (nested rule fields)
Each entry is a selectorRule object:
| Field | Key | Type | Default | Possible values | Shown when |
|---|---|---|---|---|---|
| Key | key | string | metric | Output key for the extracted value | Always |
| CSS Selector | selector | string | [data-testid=metric] | CSS selector to read from | Always |
| Type | type | options | text | text — Text; texts — Texts; attr — Attribute; attrs — Attributes | Always |
| Attribute Name | attrName | string | href | Attribute to read | type = attr, attrs |
Notes
- Parameters are resolved through the resolver engine before execution.
- The browser is launched with
chromium.launch({ headless: false })— a non-headless Chromium — using a freshnewContext/newPage. The page's default timeout is set fromtimeoutMs. - Form login (
auth.type = form) navigates tologinUrl(networkidle), fills username and password, clicks submit. IfotpSelectoris set it waits up to 8000 ms for it; on timeout it returns silently. When the OTP field appears anduseTotpistrue, a 6-digit TOTP is generated fromauth.totpSecret(viaotplib), filled in, optionally submitted viaotpSubmitSelector, then waits fornetworkidle. If the OTP field is present butuseTotpisfalse, it throwsOTP required but useTotp is disabled.; ifuseTotpistruewithout a secret it throws. - Steps run in array order:
gotonavigates tostep.url(falling back to the top-levelurl) with the chosenwaitUntil;fillandclickact on the selector;waitForSelectorwaits for the element;waitForTimeoutsleeps.extractreads each rule —text→ first element'stextContent,texts→ all text contents,attr→ first element's attribute,attrs→ that attribute across all matches — into theextractedmap underrule.key. - After each step, if
includeHtmlis true the currentpage.content()is captured aslastHtml. - Output is a single item
{ url, finalUrl, title, extracted, html?, timings: { totalMs } }. Errors are caught and returned as{ error: true, message, timings }(not thrown). The page and browser are always closed infinally.