Web browser automation commands

Our browser automation API currently supports following commands for interaction with your web page (commands are sorted alphabetically):

click

Click on an HTML element based on the given selector.

JSON usage

{ "click": { "selector": "yourSelectorValue" }}

Parameters

Param Type Details
selector string CSS selector to query, for example: #elementWithId, .elementWithCssClass, input.elementWthCssClass, div

pause

Pauses execution for a specific amount of time.

JSON usage

{ "pause": { "delay": yourDelayInMilliseconds }}

Parameters

Param Type Details
delay integer Time in milliseconds between 1 and 15 000

scroll

Scroll to a specific element. You can also append/pass two offset values as parameter to scroll to a specific position.

JSON usage

{ "scroll": { "selector": "yourSelectorValue", "offsetX": offsetXValue, "offsetY": offsetYValue }}

Parameters

Param Type Details
selector string CSS selector element to scroll to (optional)
offsetX integer X offset in pixels to scroll to (default: 0).
offsetY integer Y offset in pixels to scroll to (default: 0).

setValue

Send a sequence of key strokes to an element (clears value before).

JSON usage

{ "setValue": { "selector": "yourSelectorValue", "value": "yourValueToBeSet", "isSensitive": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for input element
value string Value set to input element(s).
isSensitive boolean If value is sensitive (for example password) you can set this argument to true so we don't include it in test report (default: false).

submitForm

Submits a first form found by given selector.

JSON usage

{ "submitForm": { "selector": "yourSelectorValue" }}

Parameters

Param Type Details
selector string CSS selector for form element

waitForEnabled

Wait for an element (selected by css selector) for the provided amount of milliseconds to be enabled (default) or disabled (reverse flag set to true).

JSON usage

{ "waitForEnabled": { "selector": "yourSelectorValue", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).

waitForExist

Wait for an element (selected by css selector) for the provided amount of milliseconds to be present within the DOM.

JSON usage

{ "waitForExist": { "selector": "yourSelectorValue", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).

waitForSelected

Wait for an option or radio/checkbox element (selected by css selector) for the provided amount of milliseconds to be (un)selected or (un)checked.

JSON usage

{ "waitForSelected": { "selector": "yourSelectorValue", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).

waitForText

Wait for an element (selected by css selector) for the provided amount of milliseconds to have text/content.

JSON usage

{ "waitForText": { "selector": "yourSelectorValue", "comparison": "comparisonEnumeration", "text": "textValueToMatch", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue, "isSensitive": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
comparison string enumeration One of following values: "equals", "equalsIgnoreCase", "contains", "containsIgnoreCase", "regex", "regexIgnoreCase" (default: "equals")
text string Waits for element and compares text/content with this parameter. If this parameter is not provided it waits for any text. You can negate this operation by setting reverse parameter to true.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).
isSensitive boolean If text is sensitive you can set this argument to true so we don't include it in test report (default: false).

waitForValue

Wait for an element (selected by css selector) for the provided amount of milliseconds to have a value.

JSON usage

{ "waitForValue": { "selector": "yourSelectorValue", "comparison": "comparisonEnumeration", "value": "valueToMatch", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue, "isSensitive": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
comparison string enumeration One of following values: "equals", "equalsIgnoreCase", "contains", "containsIgnoreCase", "regex", "regexIgnoreCase" (default: "equals")
value string Waits for element and compares value attribute with this parameter. If this parameter is not provided it waits for any value. You can negate this operation by setting reverse parameter to true.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).
isSensitive boolean If value is sensitive you can set this argument to true so we don't include it in test report (default: false).

waitForVisible

Wait for an element (selected by css selector) for the provided amount of milliseconds to be visible or invisible (reverse flag set to true).

JSON usage

{ "waitForVisible": { "selector": "yourSelectorValue", "timeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}

Parameters

Param Type Details
selector string CSS selector for element to wait for.
timeout integer How much time in milliseconds do we wait for element to be present within the DOM (default: 500).
reverse boolean If true it waits for the opposite (default: false).