browser Browser
Manages browser sessions.
Actions (--action)
--action:open
| Parameter | Value | Default | Description |
|---|
--url | text | | |
--browser | one of default, chrome, edge, firefox | default | Browser to open; 'default' uses the agent machine's default browser |
--headless | true / false | false | |
--output | variable name | | Variable for this browser; other web commands target it with --browser:$name$ |
--action:navigate
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--url required | text | | |
Turns the mouse wheel over the middle of the page, as the user would (pages that load more as they scroll react too).
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--amount required | number | | Wheel notches: positive scrolls up, negative down (one notch is about 100 pixels) |
--action:close
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--action:refresh
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--action:back
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--action:forward
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--action:screenshot
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--screenshot required | text | | Screenshot file path A file on the agent machine. |
--action:getcurrenturl
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--output required | variable name | | Variable that receives the result |
--action:gettitle
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--output required | variable name | | Variable that receives the result |
--action:executejs
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--script required | text | | |
--output | variable name | | Variable that receives the result |
--action:newtab
Opens a new tab in the browser; the following commands act on it.
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--url | text | | |
--action:switchtab
Makes another tab (or pop-up) of the browser the one commands act on; --browser:$variable$ then means that tab.
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--title | text | | Title of the tab (wildcards: *Invoice*) |
--url | text | | Address of the tab (wildcards: *orders/new*); used with or instead of the title |
--timeout | number | 30 | Timeout in seconds |
--action:closetab
Closes the current tab; the previous one becomes current.
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--action:gettabs
The tabs of the browser as records (Title, Url, IsCurrent).
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--output required | variable name | | Variable that receives the result |
--action:ondialog
How alert, confirm and prompt dialogs of pages are answered from now on. Without this command they are dismissed (Cancel).
| Parameter | Value | Default | Description |
|---|
--accept | true / false | true | true answers OK, false Cancel |
--text | text | | Text typed into prompt dialogs |
--action:getlastdialog
The message of the last dialog a page showed.
| Parameter | Value | Default | Description |
|---|
--output required | variable name | | Variable that receives the result |
--action:getcookies
The cookies of the browser as records (Name, Value, Domain, Path, Expires).
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--output required | variable name | | Variable that receives the result |
--action:setcookie
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--name required | text | | |
--value required | text | | |
--domain | text | | Site the cookie belongs to; the current page's site when empty |
--path | text | / | |
--action:clearcookies
| Parameter | Value | Default | Description |
|---|
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
Examples
browser --action:open --url:"https://example.com" --output:session
browser --action:navigate --url:"https://other.com"
browser --action:close
browser --action:open --url:"https://shop.example.com" --output:shop
browser --action:open --url:"https://erp.local" --output:erp
capture --browser:$shop$ --action:gettext --dompath:"#price" --output:price
capture --browser:$erp$ --action:settext --dompath:"#amount" --value:$price$
browser --browser:$shop$ --action:close
browser --action:newtab --url:"https://example.com/orders"
browser --browser:$shop$ --action:switchtab --title:"*Invoice*" --timeout:10
browser --action:switchtab --url:"*orders/new*"
browser --action:closetab
browser --action:gettabs --output:tabs
browser --action:ondialog --accept:true --text:"duplicate order"
browser --action:getlastdialog --output:message
browser --action:setcookie --name:session --value:$token$ --domain:"example.com"
browser --action:getcookies --output:cookies
browser --action:clearcookies
capture Capture
Interacts with a web page element.
Parameters of every variant
| Parameter | Value | Default | Description |
|---|
--window | $variable$ | | Browser window by title (a set --type:window variable); used when --browser is not given |
--browser | $variable$ | | Browser from browser --action:open --output (default: the page used last) |
--dompath required | text | | XPath or CSS selector |
--frame | text | | Selector of the iframe the element is in, e.g. #payment; nested frames as outer >> inner. The page itself when empty |
--properties | text | | Object properties of the captured element. Every checked property must match; the selector is built from them |
--anchor | text | | Selector of a nearby element that does not change (a label, a heading); among several matches of --dompath the one closest to it is used |
--anchorposition | one of near, right, left, below, above | near | Where the element is, seen from the anchor: the closest match on that side is used |
--fallback | text | | Other selectors to try when the first finds nothing, separated by " || ". Alternatives from the properties table are tried after them by themselves |
--timeout | number | 30 | Timeout in seconds |
--retry | number | | Number of retry attempts. When not set, screen and file commands try once more after a passing problem (a page still loading, a covered element, a locked file); 0 turns that off |
--retryinterval | number | 1 | Seconds between retries |
Actions (--action)
--action:click
No further parameters.
--action:doubleclick
No further parameters.
--action:rightclick
No further parameters.
--action:clear
No further parameters.
--action:check
No further parameters.
--action:uncheck
No further parameters.
--action:hover
No further parameters.
--action:focus
No further parameters.
--action:submit
No further parameters.
--action:waitfor
No further parameters.
--action:settext
Replaces the text of a field (formerly: type).
| Parameter | Value | Default | Description |
|---|
--value required | text | | |
--action:appendtext
Adds text after what a field already holds.
| Parameter | Value | Default | Description |
|---|
--value required | text | | |
Turns the mouse wheel over the element: for lists, panels and tables that scroll inside the page.
| Parameter | Value | Default | Description |
|---|
--amount required | number | | Wheel notches: positive scrolls up, negative down (one notch is about 100 pixels) |
--action:sendkeys
Focuses the element and presses keys there, as the keyboard would: text, special keys and shortcuts.
| Parameter | Value | Default | Description |
|---|
--keys required | keys | | Text and special keys in brackets, e.g. [TAB], [ESC], [CTRL+A], [DOWN][ENTER]. Use [[ for a literal [ |
--action:select
Selects an option of a drop-down list by its value or text.
| Parameter | Value | Default | Description |
|---|
--value required | text | | |
--action:selectindex
Selects the option of a drop-down list at a position.
| Parameter | Value | Default | Description |
|---|
--index required | number | | Position of the option: 1 = first |
--action:getproperty
Reads a property, a state (visible, enabled, checked), the selected option or the position of the element.
| Parameter | Value | Default | Description |
|---|
--property required | text | | value, text, visible, checked, selectedtext, x, … or any attribute |
--output required | variable name | | Variable that receives the result |
--action:setproperty
| Parameter | Value | Default | Description |
|---|
--property required | text | | value, text, innerhtml or any attribute |
--value required | text | | |
--action:getattribute
| Parameter | Value | Default | Description |
|---|
--property required | text | | Attribute name |
--output required | variable name | | Variable that receives the result |
--action:gettext
| Parameter | Value | Default | Description |
|---|
--output required | variable name | | Variable that receives the result |
--action:exists
| Parameter | Value | Default | Description |
|---|
--output required | variable name | | Variable that receives the result |
--action:gettable
Reads an HTML table into a datatable variable: capture the table, one of its cells, or an element that contains it. Loop over the rows with loop --type:datatable.
| Parameter | Value | Default | Description |
|---|
--header | true / false | true | The header row (thead, else the first row) names the columns; false: Column1, Column2… and every row is data |
--output required | variable name | | Variable that receives the result |
Reads repeating items (product cards, search results, list rows) into a datatable: --dompath matches every item, each column reads one value inside an item, and --next turns the pages. Made with the Extract data wizard.
| Parameter | Value | Default | Description |
|---|
--columns required | text | | The columns as JSON: [{"name":"Title","path":".//h3","read":"text"}]. path is relative to the item (. is the item itself); read is text, value, href, src, html or any attribute name |
--next | text | | Selector of the Next page button or link: after a page is read it is clicked, until it is missing or disabled. One page when empty |
--maxpages | number | 10 | Pages to read at most (with --next) |
--maxrows | number | 0 | Rows to read at most; 0 reads all |
--output required | variable name | | Variable that receives the result |
--action:screenshot
| Parameter | Value | Default | Description |
|---|
--path required | text | | Screenshot file path A file on the agent machine. |
--action:upload
Chooses files for an upload: on a file input, or on the button that opens the file dialog.
| Parameter | Value | Default | Description |
|---|
--file required | text | | File to upload; several separated by commas A file on the agent machine. |
--action:download
Clicks the element and saves the file the site then downloads; --output receives the saved file.
| Parameter | Value | Default | Description |
|---|
--path required | text | | File to save as, or a folder (the site's file name is used) A file on the agent machine. |
--output | variable name | | Variable that receives the result |
Examples
capture --action:click --dompath:"//button[@id='login']"
capture --action:settext --dompath:"//input[@name='email']" --value:"user@test.com"
capture --action:getproperty --dompath:"//h1" --property:text --output:pageTitle
capture --action:select --dompath:"//select[@id='country']" --value:"Turkey"
capture --action:selectindex --dompath:"//select[@id='country']" --index:2
capture --action:appendtext --dompath:"#note" --value:" (urgent)"
capture --action:getproperty --dompath:"#agree" --property:checked --output:agreed
capture --action:exists --dompath:"//div[@class='error']" --output:hasError
capture --action:click --frame:"#payment" --dompath:"#pay"
capture --action:upload --dompath:"input[type=file]" --file:"C:\a.pdf, C:\b.pdf"
capture --action:download --dompath:"#export" --path:"C:\Downloads" --output:file
capture --action:gettable --dompath:"#orders" --output:orders
capture --action:extract --dompath:"//div[@id='results']/ul/li/div" --columns:[{"name":"Title","path":".//h3","read":"text"},{"name":"Price","path":".//span[@class='price']","read":"text"},{"name":"Link","path":".//a","read":"href"}] --next:"//a[normalize-space()='Next']" --maxpages:10 --output:products