Condition commands
if If
Runs the enclosed commands when a condition is true.
Block command: if … endif with elseif, else.
Types (--type, optional)
--type:expression
A free-form condition expression.
| Parameter | Value | Default | Description |
|---|---|---|---|
--condition required | condition | e.g. $count$ > 5 and $status$ = "ok" |
--type:string
Compares text.
| Parameter | Value | Default | Description |
|---|---|---|---|
--left required | any value | Text or $variable$ to test | |
--operator required | one of equals, notequals, contains, notcontains, startswith, endswith, matches, isempty, isnotempty | ||
--right | any value | Value to compare with (not used by isempty/isnotempty; regex for matches) | |
--ignorecase | true / false | false |
--type:number
Compares numbers.
| Parameter | Value | Default | Description |
|---|---|---|---|
--left required | number | Number or $variable$ to test | |
--operator required | one of =, !=, >, <, >=, <= | ||
--right required | number | Number or $variable$ to compare with |
--type:boolean
Checks a true/false value.
| Parameter | Value | Default | Description |
|---|---|---|---|
--value required | any value | The true/false $variable$ to check, e.g. $found$ | |
--is | one of true, false | true | The condition holds when the value is this |
--type:fileexists
True when the file (or a file matching the wildcard) exists.
| Parameter | Value | Default | Description |
|---|---|---|---|
--path required | text | File path; wildcards allowed, e.g. C:\Reports\*.xlsx (any matching file in the folder) A file on the agent machine. |
--type:filenotexists
True when no matching file exists.
| Parameter | Value | Default | Description |
|---|---|---|---|
--path required | text | File path; wildcards allowed, e.g. C:\Reports\*.xlsx (any matching file in the folder) A file on the agent machine. |
--type:folderexists
True when the folder (or a matching folder) exists.
| Parameter | Value | Default | Description |
|---|---|---|---|
--path required | text | Folder path; wildcards allowed, e.g. C:\Projects\2026* (any matching subfolder) A folder on the agent machine. |
--type:foldernotexists
True when no matching folder exists.
| Parameter | Value | Default | Description |
|---|---|---|---|
--path required | text | Folder path; wildcards allowed, e.g. C:\Projects\2026* (any matching subfolder) A folder on the agent machine. |
--type:windowexists
True when the window is open (optionally waiting up to --timeout seconds).
| Parameter | Value | Default | Description |
|---|---|---|---|
--window required | $variable$ | Window from window --action:open/attach, or a set --type:window pattern | |
--timeout | number | 0 | Seconds to wait for the window |
--type:windownotexists
True when the window is not open (optionally waiting up to --timeout seconds for it to close).
| Parameter | Value | Default | Description |
|---|---|---|---|
--window required | $variable$ | Window from window --action:open/attach, or a set --type:window pattern | |
--timeout | number | 0 | Seconds to wait for the window to close |
--type:elementexists
True when the web element is shown on the page (optionally waiting up to --timeout seconds for it to appear). A missing element is simply false.
| Parameter | Value | Default | Description |
|---|---|---|---|
--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 | 0 | Seconds to wait for the element to appear before deciding (0: check once, now) |
--type:elementnotexists
True when the web element is hidden or not on the page (optionally waiting up to --timeout seconds for it to go away).
| Parameter | Value | Default | Description |
|---|---|---|---|
--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 | 0 | Seconds to wait for the element to disappear before deciding (0: check once, now) |
--type:desktopelementexists
True when the desktop element is in the window (optionally waiting up to --timeout seconds for it to appear). A missing element or window is simply false.
| Parameter | Value | Default | Description |
|---|---|---|---|
--window required | $variable$ | Window from window --action:open/attach, or a set --type:window pattern | |
--by required | one of automationid, name, classname, xpath, index | ||
--target required | text | Identifier value | |
--properties | text | Object properties of the captured element. Every checked property must match; the selector is built from them | |
--anchor | text | A nearby element that does not change, e.g. name=Amount, automationid=lblTotal, classname=Static or an XPath; among several matches of --target 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 | 0 | Seconds to wait for the element to appear before deciding (0: check once, now) |
--type:desktopelementnotexists
True when the desktop element is not in the window (optionally waiting up to --timeout seconds for it to go away).
| Parameter | Value | Default | Description |
|---|---|---|---|
--window required | $variable$ | Window from window --action:open/attach, or a set --type:window pattern | |
--by required | one of automationid, name, classname, xpath, index | ||
--target required | text | Identifier value | |
--properties | text | Object properties of the captured element. Every checked property must match; the selector is built from them | |
--anchor | text | A nearby element that does not change, e.g. name=Amount, automationid=lblTotal, classname=Static or an XPath; among several matches of --target 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 | 0 | Seconds to wait for the element to disappear before deciding (0: check once, now) |
--type:imageexists
True when the picture is on the screen or in the window (optionally waiting up to --timeout seconds for it to appear).
| Parameter | Value | Default | Description |
|---|---|---|---|
--image required | text | The picture to look for: mark it on the screen (Capture picture), or a .png/.jpg/.bmp file on the agent machine | |
--window | $variable$ | Look only in this window (brought to the front first); the whole screen when empty | |
--similarity | number | 90 | How similar a spot must be, in percent (50–100). Lower finds pictures that changed a little (colours, smoothing); higher avoids look-alikes |
--timeout | number | 0 | Seconds to wait for the picture to appear before deciding (0: check once, now) |
--type:imagenotexists
True when the picture is not on the screen (optionally waiting up to --timeout seconds for it to go away).
| Parameter | Value | Default | Description |
|---|---|---|---|
--image required | text | The picture to look for: mark it on the screen (Capture picture), or a .png/.jpg/.bmp file on the agent machine | |
--window | $variable$ | Look only in this window (brought to the front first); the whole screen when empty | |
--similarity | number | 90 | How similar a spot must be, in percent (50–100). Lower finds pictures that changed a little (colours, smoothing); higher avoids look-alikes |
--timeout | number | 0 | Seconds to wait for the picture to disappear before deciding (0: check once, now) |
Without --type (Expression)
| Parameter | Value | Default | Description |
|---|---|---|---|
--condition required | condition | e.g. $count$ > 5 and $status$ = "ok" |
Clause elseif
No parameters.
Clause else
No parameters.
Examples
if --condition:$status$="active"
log --message:"Status is active"
elseif --condition:$status$="pending"
log --message:"Status is pending"
else
log --message:"Unknown status"
endif
if --type:elementexists --dompath:"//button[@id='save']" --timeout:5
capture --action:click --dompath:"//button[@id='save']"
elseif --type:desktopelementexists --window:$erp$ --by:name --target:Save
desktop --action:click --window:$erp$ --by:name --target:Save
elseif --type:imageexists --image:"C:\Pictures\save.png" --window:$citrix$
image --action:click --image:"C:\Pictures\save.png" --window:$citrix$
endif
if --type:elementnotexists --browser:$web$ --dompath:".spinner" --timeout:30
log --message:"The page is ready"
endif
switch Switch
Runs the commands of the first case whose value equals the switch value (compared as text; numbers such as 1 and 1.0 are equal), or the default section when no case matches.
Block command: switch … endswitch with case, default.
Parameters
| Parameter | Value | Default | Description |
|---|---|---|---|
--value required | any value | The value the cases are compared with, e.g. $status$ | |
--ignorecase | true / false | false | true: Approved, APPROVED and approved are the same |
Clause case
| Parameter | Value | Default | Description |
|---|---|---|---|
--value required | any value | Runs this section when the switch value equals this, e.g. Approved or 1 |
Clause default
No parameters.
Examples
switch --value:$status$ --ignorecase:true
case --value:Approved
log --message:"Book the invoice"
case --value:Rejected
mail --to:$requester$ --subject:"Invoice rejected" --body:$reason$
case --value:1
log --message:"Priority one"
default
log --message:"Unknown status $status$" --level:warning
endswitch