BotreamDocs Website Türkçe v0.1.1

Condition commands

if · switch

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.

ParameterValueDefaultDescription
--condition requiredconditione.g. $count$ > 5 and $status$ = "ok"
--type:string

Compares text.

ParameterValueDefaultDescription
--left requiredany valueText or $variable$ to test
--operator requiredone of equals, notequals, contains, notcontains, startswith, endswith, matches, isempty, isnotempty
--rightany valueValue to compare with (not used by isempty/isnotempty; regex for matches)
--ignorecasetrue / falsefalse
--type:number

Compares numbers.

ParameterValueDefaultDescription
--left requirednumberNumber or $variable$ to test
--operator requiredone of =, !=, >, <, >=, <=
--right requirednumberNumber or $variable$ to compare with
--type:boolean

Checks a true/false value.

ParameterValueDefaultDescription
--value requiredany valueThe true/false $variable$ to check, e.g. $found$
--isone of true, falsetrueThe condition holds when the value is this
--type:fileexists

True when the file (or a file matching the wildcard) exists.

ParameterValueDefaultDescription
--path requiredtextFile 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.

ParameterValueDefaultDescription
--path requiredtextFile 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.

ParameterValueDefaultDescription
--path requiredtextFolder 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.

ParameterValueDefaultDescription
--path requiredtextFolder 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).

ParameterValueDefaultDescription
--window required$variable$Window from window --action:open/attach, or a set --type:window pattern
--timeoutnumber0Seconds to wait for the window
--type:windownotexists

True when the window is not open (optionally waiting up to --timeout seconds for it to close).

ParameterValueDefaultDescription
--window required$variable$Window from window --action:open/attach, or a set --type:window pattern
--timeoutnumber0Seconds 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.

ParameterValueDefaultDescription
--browser$variable$Browser from browser --action:open --output (default: the page used last)
--dompath requiredtextXPath or CSS selector
--frametextSelector of the iframe the element is in, e.g. #payment; nested frames as outer >> inner. The page itself when empty
--propertiestextObject properties of the captured element. Every checked property must match; the selector is built from them
--anchortextSelector of a nearby element that does not change (a label, a heading); among several matches of --dompath the one closest to it is used
--anchorpositionone of near, right, left, below, abovenearWhere the element is, seen from the anchor: the closest match on that side is used
--fallbacktextOther selectors to try when the first finds nothing, separated by " || ". Alternatives from the properties table are tried after them by themselves
--timeoutnumber0Seconds 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).

ParameterValueDefaultDescription
--browser$variable$Browser from browser --action:open --output (default: the page used last)
--dompath requiredtextXPath or CSS selector
--frametextSelector of the iframe the element is in, e.g. #payment; nested frames as outer >> inner. The page itself when empty
--propertiestextObject properties of the captured element. Every checked property must match; the selector is built from them
--anchortextSelector of a nearby element that does not change (a label, a heading); among several matches of --dompath the one closest to it is used
--anchorpositionone of near, right, left, below, abovenearWhere the element is, seen from the anchor: the closest match on that side is used
--fallbacktextOther selectors to try when the first finds nothing, separated by " || ". Alternatives from the properties table are tried after them by themselves
--timeoutnumber0Seconds 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.

ParameterValueDefaultDescription
--window required$variable$Window from window --action:open/attach, or a set --type:window pattern
--by requiredone of automationid, name, classname, xpath, index
--target requiredtextIdentifier value
--propertiestextObject properties of the captured element. Every checked property must match; the selector is built from them
--anchortextA 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
--anchorpositionone of near, right, left, below, abovenearWhere the element is, seen from the anchor: the closest match on that side is used
--fallbacktextOther selectors to try when the first finds nothing, separated by " || ". Alternatives from the properties table are tried after them by themselves
--timeoutnumber0Seconds 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).

ParameterValueDefaultDescription
--window required$variable$Window from window --action:open/attach, or a set --type:window pattern
--by requiredone of automationid, name, classname, xpath, index
--target requiredtextIdentifier value
--propertiestextObject properties of the captured element. Every checked property must match; the selector is built from them
--anchortextA 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
--anchorpositionone of near, right, left, below, abovenearWhere the element is, seen from the anchor: the closest match on that side is used
--fallbacktextOther selectors to try when the first finds nothing, separated by " || ". Alternatives from the properties table are tried after them by themselves
--timeoutnumber0Seconds 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).

ParameterValueDefaultDescription
--image requiredtextThe 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
--similaritynumber90How similar a spot must be, in percent (50–100). Lower finds pictures that changed a little (colours, smoothing); higher avoids look-alikes
--timeoutnumber0Seconds 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).

ParameterValueDefaultDescription
--image requiredtextThe 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
--similaritynumber90How similar a spot must be, in percent (50–100). Lower finds pictures that changed a little (colours, smoothing); higher avoids look-alikes
--timeoutnumber0Seconds to wait for the picture to disappear before deciding (0: check once, now)
Without --type (Expression)
ParameterValueDefaultDescription
--condition requiredconditione.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

ParameterValueDefaultDescription
--value requiredany valueThe value the cases are compared with, e.g. $status$
--ignorecasetrue / falsefalsetrue: Approved, APPROVED and approved are the same

Clause case

ParameterValueDefaultDescription
--value requiredany valueRuns 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
Botream 0.1.1 · Generated 2026-10-14