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 | Optional | Details |
---|---|---|---|
selector | string | N | 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 | Optional | Details |
---|---|---|---|
delay | integer | N | 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 | Optional | Details |
---|---|---|---|
selector | string | Y | CSS selector element to scroll to (optional) |
offsetX | integer | Y | X offset in pixels to scroll to (default: 0). |
offsetY | integer | Y | 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 | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for input element |
value | string | N | Value set to input element(s). |
isSensitive | boolean | Y | 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 | Optional | Details |
---|---|---|---|
selector | string | N | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue, "isSensitive": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
comparison | string enumeration | Y | One of following values: "equals", "equalsIgnoreCase", "contains", "containsIgnoreCase", "regex", "regexIgnoreCase" (default: "equals") |
text | string | Y | 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. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | If true it waits for the opposite (default: false). |
isSensitive | boolean | Y | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue, "isSensitive": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
comparison | string enumeration | Y | One of following values: "equals", "equalsIgnoreCase", "contains", "containsIgnoreCase", "regex", "regexIgnoreCase" (default: "equals") |
value | string | Y | 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. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | If true it waits for the opposite (default: false). |
isSensitive | boolean | Y | 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", "conditionTimeout": yourTimeoutValueInMilliseconds, "reverse": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
selector | string | N | CSS selector for element to wait for. |
conditionTimeout | integer | Y | How much time in milliseconds do we wait for element to be present within the DOM (default: 5000). |
reverse | boolean | Y | If true it waits for the opposite (default: false). |
waitForNavigation
Waits for page navigation to complete for the provided amount of milliseconds.
JSON usage
{ "waitForNavigation": { "conditionTimeout": yourTimeoutValueInMilliseconds, "continueOnError": booleanValue }}
Parameters
Param | Type | Optional | Details |
---|---|---|---|
conditionTimeout | integer | Y | How much time in milliseconds do we wait for page navigation to complete (default: 5000). |
continueOnError | boolean | Y | If this value is true, test will not fail and will continue with next step (default: false). |
{ "click": { "selector": "yourSelectorValue", "comment": "your optional comment" }}