DocsRPA → Command reference

Command reference

Every step type you can add to a process, with its parameters. Commands are grouped the way they appear in the builder.

Command reference

Navigation & interaction
CommandParametersWhat it does
gotourl, waitUntil?Navigate to a URL. waitUntil is load, domcontentloaded (default), networkidle0, or networkidle2.
clickselector, button?, clicks?Click the matched element. button picks left (default) / right / middle; clicks set to 2 fires a real double-click.
typeselector, text, delayMs?, clearFirst?Type text into the matched element, optionally with a per-keystroke delay for a more human pace. clearFirst selects the field's existing contents so the new text replaces rather than appends.
presskeyPress a single keyboard key (e.g. Enter, Tab).
keyCombo Keys combinationcomboA modifier chord: select all, copy, paste, or reload. Uses ⌘ on a macOS-fingerprinted profile and Ctrl otherwise — read from the profile's spoofed OS, not the host's.
focus FocusselectorPut the cursor in an element without clicking it — useful when a click would trigger a handler or dismiss an overlay.
uploadFile Input Fileselector, pathSet a file input's selection, as if a user picked the file. The file must already be in this profile's RPA files folder (put it there with Save to Txt / Save to Excel / Download File first) — a process can't reach arbitrary files on your disk.
hoverselectorMove the mouse over the matched element.
selectselector, valueChoose an option in a <select> element by value.
scrollselector?, position?, x?/y?, smooth?Scroll an element into view, jump to top/middle/bottom of the page, or scroll to absolute coordinates. smooth animates it (and waits for the animation to settle before the next step).
waitms, maxMs?Pause for a fixed number of milliseconds — or, with maxMs, a random duration between the two, for pacing that doesn't look machine-timed.
waitForSelectorselector, timeoutMs?Wait for an element to appear before continuing.
waitForRequest Request to finishurlPattern, timeoutMs?Wait until the page makes a network call whose URL contains urlPattern and it completes. A barrier only — use the listener commands if you also need the response body.
Data & debugging
CommandParametersWhat it does
screenshotname, fullPage?, format?, quality?Capture the current page, saved under the given name in the run's Debug log. fullPage captures the whole scrollable page rather than the viewport; format picks png (default) or jpeg with a quality of 0-100.
extractTextselector, variableRead an element's text content into a variable for later steps to use.
extractAttributeselector, attribute, variableRead one attribute's value (e.g. href) into a variable.
evaluatescript, variable?Run raw JavaScript in the page and, if given, capture its return value into a variable. Times out after 30 seconds so a stuck script can't hang the whole run.
Tabs & browser
CommandParametersWhat it does
newTabOpen a new tab and switch to it.
closeTabClose the current tab and fall back to another. Refuses to close the last remaining tab.
closeOtherTabs Close Other TabsClose every tab except the current one.
switchTabindex, match?, matchBy?Switch to the tab at the given index — or, with match, the first tab whose url or title contains it. Matching is sturdier than an index once a site opens its own popups.
goBackNavigate back in history.
refreshReload the current page.
closeBrowserClose the whole browser, ending the run.
Page info
CommandParametersWhat it does
getUrlvariable, extract?, parameter?Capture the current page URL into a variable. extract picks full (default), domain (hostname only), or parameter (one query-string value, named by parameter).
getTitlevariableCapture the current page title into a variable.
Get Data
CommandParametersWhat it does
getFocusedElement Focused Elementvariable, as?Whatever currently has focus (document.activeElement). as=value (default) saves its value for a form field, otherwise its text; as=object saves the element itself for reuse.
saveElement Element → Object / iFrame / Childselector, kind, childSelector?, order?, index?, fromElement?, variableSaves the element itself rather than text pulled out of it, so later steps act on that exact node even after the page re-renders or a list reorders. kind is object, iframe (its content frame), or childElement. order picks the first match, a fixed index, or a random one. Saved elements last for the run only and are used via the fromElement field on later steps — they are not available to ${...} text.
getElementHtml Elementselector, variableThe matched element's full outerHTML — distinct from Extract text (text only) and Extract attribute (one attribute only).
getCookies Get Page CookievariableEvery cookie visible to the current page, as a JSON array string.
clearCookies Clear Page CookieDeletes every cookie visible to the current page.
saveToFile Save to Txtvariable, filenameWrites a variable's current value to a file, sandboxed to this profile's own RPA-files folder — a filename with ../ in it is stripped down to just the filename, it can never write outside that folder.
importFromFile Import Data from Txtpath, variableReads a file's whole text content into a variable, from that same sandboxed folder.
saveToExcel Save to Excelfilename, columnsAppends one row to a real .xlsx, creating it with a header row on first use. columns is a comma-separated list of variable names — each becomes a column header and that variable's current value becomes the cell. Appends rather than overwrites, so a row accumulates per loop iteration.
importFromExcel Import Data from Excelpath, serialNumberColumn?, variableReads an .xlsx into a variable as a JSON array of row objects keyed by the header row — feed it straight into a forData loop via itemsFromVariable. With serialNumberColumn, only rows whose cell in that column matches this profile's name (or id) are kept, so one shared spreadsheet can drive a whole batch with each profile taking its own rows.
getClipboard Clipboard ContentvariableReads the system clipboard.
setClipboardtextWrites to the system clipboard.
startListener Listener Requestname, urlPatternStarts watching network responses whose URL contains urlPattern, capturing the latest match's body — non-blocking, the process keeps running while it watches.
awaitListener Listener Request Responsename, variable, timeoutMs?, extract?Waits (30s default) for the named listener to capture an exchange, then saves one part of it: the response body (default), the full url, the request headers, its getParams, or its postData. Headers and GET parameters are saved as JSON, so a following extractField can pull a single key out.
stopListener Stop Listener RequestnameStops watching and discards a named listener.
downloadFile Download Fileselector or url, saveAs?, variable?Either clicks an element expected to trigger a browser download, or fetches a url directly (same session, so the profile's cookies/proxy still apply) — waits for the file to finish landing in this profile's downloads folder, optionally renames it, and can save the resulting path into a variable.
Flow control
CommandParametersWhat it does
ifcondition, then, else?Branch on a condition (see below). else is optional — with no matching branch, execution just continues to the next step.
loop For Loop Timescount, bodyRepeat a set of steps count times, up to a cap of 10,000 iterations (enforced even if you paste a larger value via Import). A malformed count (zero, negative, fractional) safely floors to 1.
forElements For Loop Elementsselector, indexVariable, bodyRun once per element currently matching selector (also capped at 10,000). Each iteration sets indexVariable to that element's 0-based index as a string.
forData For Loop Dataitems or itemsFromVariable, itemVariable, indexVariable?, bodyRun once per item. Items come from either a fixed list typed into the step, or — with itemsFromVariable — a JSON array/object held in a variable, which is what lets an imported spreadsheet or Google Sheet drive the loop. An object iterates its values; an item that is itself an object arrives as JSON so the body can extractField into it.
whileLoop While Loopcondition, bodyRepeat while condition holds, re-checked before every iteration. Also capped at 10,000 iterations — unlike the loops above, a condition has no natural bound of its own, so this is what stops a condition that never flips from spinning forever.
exitLoop Exit LoopImmediately stops the nearest enclosing loop (any of the four above) and continues with whatever comes after it — like break in a normal language. Works from inside a nested if too. With no enclosing loop at all, it just stops the remaining steps in its own sequence.
Third-party tools
CommandParametersWhat it does
googleSheet Google Sheet operation, spreadsheetId, worksheetName, scope?, firstRowIsKey?, variable?, values?, append? Read, write, or clear spreadsheet data. A sheet shared as "Anyone with the link" reads with no setup; writing always needs a service-account key — see the setup section below.

Using loop variables — ${...}

forElements, forData, and whileLoop are only useful if body steps can act on the current item — so any selector, text, URL, or value field elsewhere in the process can reference a captured variable with ${variableName}, substituted fresh on every iteration. This works with any variable — one set by extractText/extractAttribute/evaluate earlier in the process too, not just a loop's own index/item variable.

{ "type": "forData", "items": ["alice@example.com", "bob@example.com"],
  "itemVariable": "email",
  "body": [
    { "type": "type", "selector": "#email", "text": "${email}" },
    { "type": "click", "selector": "#submit" }
  ]
}
Not interpolated: evaluate's script (it's raw JavaScript — read a variable there via the run's own variable bag instead) and condition values (those compare against literal text).