Click here to download all the examples.
Recorder-Generated Commands
Right-Click-Generated Commands
Manually Written Commands
Command | Target | Value | Description |
---|---|---|---|
clickAt | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 . A blank value means a simple click. |
Clicks on a targeted element. |
doubleClickAt | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 . A blank value means a simple double click. |
Double-clicks on a targeted element. |
mouseDownAt | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 |
Triggers a mouseDown event on a targeted element. |
mouseMoveAt | A locator | A JSON String containing a series of movements. | Triggers a sequence of mouseMove events. An example of the value will be: {\"Movements\":[{\"TD\":8,\"OX\":-2,\"OY\":0},{\"TD\":16,\"OX\":-4,\"OY\":1},{\"TD\":16,\"OX\":-5,\"OY\":1}]} , where TD means the time delay to the previous movement; OX and OY mean the x and y offsets to the previous movement. |
mouseOut | A locator | N/A | Triggers a mouseOut event on a targeted element. |
mouseOver | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 |
Triggers a mouseOver event on a targeted element. |
mouseUpAt | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 |
Triggers a mouseUp event on a targeted element. |
dragAndDrop | The locator of the element to be dragged | A JSON String containing start position, and a series of movements. | Drags an element and drops it at a certain location. An example of value: {"StartPoint":{"X":92,"Y":31},"Movements":[{"TD":8,"OX":-2,"OY":0},{"TD":16,"OX":-4,"OY":1},{"TD":16,"OX":-5,"OY":1}]} , where TD means the time delay to the previous movement. OX and OY mean the offset x and y to the previous movement. |
dragAndDropToObject | The locator of the element to be dragged | The locator of the element on which the target element is dropped | Drags an element and drops it on another element. |
changeCaretPosition | A locator | A JSON String containing node order, and text offset. | Changes the caret location on a rich text editor according to the nodes and offsets. An example of value: {"N":0,"O":5} . N means the order of node to select. O means the offset of text to focus. |
scrollWheel | The locator of the element | A JSON String containing the start position, and a series of wheel events. | Scrolls the wheel upon an element. An example of the value: {\"StartPoint\":{\"X\":92,\"Y\":31},\"Delta\":[{\"TD\":0,\"X\":0,\"Y\":-100,\"Z\":0,\"M\":0},{\"TD\":8,\"X\":0,\"Y\":-100,\"Z\":0,\"M\":0},{\"TD\":6,\"X\":0,\"Y\":100,\"Z\":0,\"M\":0} , where TD means the time delay to the previous movement. X, Y, Z, M mean the DeltaX, DeltaY, DeltaZ, deltaMode of the wheel event. |
rightClickAt | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 . |
Right-clicks on a targeted element. |
blur | A locator | x,y position of the mouse event relative to the target element. For example: 10,10 . |
Right-clicks on a targeted element. |
Command | Target | Value | Description |
---|---|---|---|
sendKeys | A locator | N/A | Triggers a blur event that will unfocus from the target element. |
submit | The locator of the form to be submitted | N/A | Submits a form. |
type | A locator | The string to be set to the target element | Chooses the value for the targeted input element which should be one of the following types: color , date , datetime-local , month , range , time , and week . |
editContent | A locator | The string to be set to the content of the target element with attribute contenteditable="true" | Edits the content of a content-editable element. |
addSelection | A locator of a multi-select box | label=option_value |
Adds a selection of an option in a multi-select box. |
removeSelection | A locator of a multi-select box | label=option_value |
Removes an option from a multi-select box. |
select | A locator of a drop-down menu | label=option_value |
Selects an element of a drop-down menu. |
Command | Target | Value | Description |
---|---|---|---|
assertAlert | The expected alert message | N/A | Asserts if the message on the alert window is correct. |
assertConfirmation | The expected confirmation message | N/A | Asserts if the message on the confirmation window is correct. |
chooseOkOnNextConfirmation | N/A | N/A | Chooses Ok on the confirmation window that will pop up. Make sure this command appears before the assertConfirmation command. |
chooseCancelOnNextConfirmation | N/A | N/A | Chooses Cancel on the confirmation window that will pop up. Make sure this command appears before the assertConfirmation command. |
assertPrompt | The expected prompt message | N/A | Asserts if the message on the prompt window is correct. |
answerOnNextPrompt | The string to be set to the next prompt pop-up | N/A | Inserts some string in the prompt window that will pop up. Make sure this command appears before the assertPrompt command. |
chooseCancelOnNextPrompt | N/A | N/A | Chooses 'cancel' on the prompt window that will pop up. Make sure this command appears before the assertPrompt command. |
Command | Target | Value | Description |
---|---|---|---|
open | A URL | N/A | Opens a webpage according to the target URL. |
setViewportSize | N/A | Width and height of the desired browser viewport size. For example: 1080,720 . |
Sets the desired browser viewport size by changing the window size. Since the difference between viewport size and window size is set by changing the window size, this command will resize the window multiple times in order to get the desired viewport size. NOTE THAT, if the browser can not be changed to fit the desired viewport size, the command will be marked as yellow. |
selectWindow | Auto-generated | N/A | Selects the target window. This command is intended to be auto-generated while recording. |
selectFrame | index=i (select the i-th frame, i starts from 0)relative=parent (Select the parent frame)relative=top (select the top frame) |
N/A | Selects the target frame. This command is intended to be auto-generated while recording. |
close | Auto-generated | N/A | Closes the target window. This command is intended to be auto-generated while recording. |
onsubmit | The locator of the form | N/A | Triggers the submit action for forms that includes other events (e.g. an alert window) before submitting the form. This command is intended to be auto-generated while recording. |
setCSS | A locator | A CSS style string. | Sets the CSS for a targeted element. For example, background-color: rgb(237, 238, 238); text-decoration: none solid rgb(102, 0, 51); |
scrollTo | A locator | x,y position of the scrollbar on the target element. For example: 50,100 | Scrolls to the desired position on a targeted element. When selecting the target manually, click on the targeted scrollbar to get the target element and its position. |
Command | Target | Value | Description |
---|---|---|---|
assertText | A locator | The expected text of the target element (Exact matching) | Asserts if the text of some targeted element is correct. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. Variables can be used in the Value. |
assertTextRegex | A locator | The regular expression rule. For example: ab+c . |
Asserts if the regular expression of some targeted element is correct. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. Variables can be used in the Value. |
assertTitle | The expected string of the title (Exact matching) | N/A | Asserts if the title of the web page is correct. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. Variables can be used in the Target. |
assertValue | A locator | The expected value of the target element (Exact matching) | Asserts if the value within some targeted input element is correct. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. Variables can be used in the Value. |
assertVisibility | A locator | N/A | Asserts if the targeted element is visible. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. If the element is fully transparent, hidden, or parts of it are covered by other elements, the verification result will fail. |
assertTooltip | A locator | The expected tooltip text (title attribute) of the target element (Exact matching) | Asserts if the text of the tooltip of some targeted element is correct. If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. Variables can be used in the Value. |
assertIsPassword | A locator | N/A | Checks if the target is an <input> element with attribute type="password". If the verification result has failed, the current test case will stop playing and the next test case will continue to execute. |
A locator | N/A | Asserts if the target element is present in the DOM tree even if it's invisible. If the verification result has failed, the current test case will stop playing and the next test case will continue to be played. | |
assertPresence | A locator | N/A | Asserts if the target element is present in the DOM tree even if it's invisible. If the verification result has failed, the current test case will stop playing and the next test case will continue to be played. |
Command | Target | Value | Description |
---|---|---|---|
verifyText | A locator | The expected text of the target element (Exact matching) | Verifies if the text of the targeted element is correct. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
verifyTextRegex | A locator | The regular expression rule. For example: ab+c . |
Verifies if the regular expression of the targeted element is correct. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
verifyTitle | The expected string of the title (Exact matching) | N/A | Verifies if the title of the web page is correct. The next command will continue to execute even if the verification result has failed. Variables can be used in the Target. |
verifyValue | A locator | The expected value of the target element (Exact matching) | Verifies if the value within the targeted input element is correct. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
verifyVisibility | A locator | N/A | Verifies if the targeted element is visible. The next command will continue to execute even if the verification result fails. If the element is fully transparent, hidden, or parts of it are covered by other elements, the verification result will fail. |
verifyTooltip | A locator | The expected tooltip text (title attribute) of the target element (Exact matching) | Verifies if the text of the tooltip of some targeted element is correct. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
verifyIsPassword | A locator | N/A | Verifies if the target is an <input> element with attribute type="password". The next command will continue to execute even if the verification result has failed. |
A locator | N/A | Verifies if the target element is present in the DOM tree even if it's invisible. The next command will continue to execute even if the verification result fails. | |
verifyPresence | A locator | N/A | Verifies if the target element is present in the DOM tree even if it's invisible. The next command will continue to execute even if the verification result fails. |
Command | Target | Value | Description |
---|---|---|---|
store | A string to store | The name of the local variable (within a test case) storing the string. For example: var_usr . |
Stores some string as a local variable. The local variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_usr} . |
storeGlobalVar | A string to store | The name of the global variable (across test cases, defined in Global Var tab) storing the string. For example: var_usr . |
Stores some string as a global variable. The global variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_usr} . |
storeEval | A Javascript expression to be executed. For example: x=2; y=3; return z = Math.max(x,y); . The example expression will be evaluated to 3 and the evaluation result will be stored in the variable declared in Value. return must be added before the expression. |
The name of the variable storing the evaluation result. For example: var_result . |
Evaluates some JavaScript expression and stores it as a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_result} . |
storeText | A locator | The name of the variable storing the text of the target element. For example: var_ele_txt . |
Stores the text of some targeted element into a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_ele_txt} . |
storeTitle | N/A | The name of the variable storing the title. For example: var_title . |
Stores the title of the web page into a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_title} . |
storeValue | The locator to an input element | The name of the variable storing the value of the target element. For example: var_ele_value . |
Stores the value of some targeted input element into a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_ele_value} . |
storeTooltip | A locator | The name of the variable storing the tooltip text (title attribute). For example: var_tooltip . |
Stores the text of the tooltip of some targeted element into a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_tooltip} . |
storeIsVisible | A locator | The name of the variable storing the visibility state of the target element. For example: var_result . |
Stores the visibility of some targeted element as a Boolean value into a local variable. The true or false string can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_result} . |
storeElement | A locator | The name of the variable storing the target element. For example: var_elem . |
Stores the target DOM tree element into a local variable. The variable can be used in another command's Target or Value by surrounding it with ${} . For example, ${var_elem} . The properties of the element can also be obtained, for example, by using ${var_elem.innerHTML} . Note that:${var_elem} in runScript and storeEval commands, the target element in DOM tree will be referenced. For example, when running `runScript |
Command | Target | Value | Description |
---|---|---|---|
waitForElementPresent | A locator | The maximum amount of milliseconds before timeout. For example: 5000 means the execution will continuously check for the element's presence within 5 seconds. Leave blank for default waiting time (10s). | Waits for the target element to be present. For example, wait for the subscribe button to show up within 5000ms after browsing to some website. |
waitForElementNotPresent | A locator | The maximum amount of milliseconds before timeout. For example: 5000 means the execution will continuously check for the element's removal from the DOM tree within 5 seconds. Leave blank for default waiting time (10s). | Waits for the target element to be removed from the DOM tree. For example, wait for the ad to be removed within 5000ms after clicking the exit button. |
waitForElementVisible | A locator | The maximum amount of milliseconds before timeout. For example: 5000 means the execution will continuously check for the element's visibility within 5 seconds. Leave blank for default waiting time (10s). | Waits for the targeted element to become visible. If the element is fully transparent, hidden, or parts of it are covered by other elements, the element is defined as invisible. For example, wait for the element's CSS attribute to go from "display:none" to "display:block" after clicking on some button. |
waitForElementNotVisible | A locator | The maximum amount of milliseconds before timeout. For example: 5000 means the execution will continuously check for the element's invisibility within 5 seconds. Leave blank for default waiting time (10s). | Waits for the targeted element to become invisible. If the element is fully transparent, hidden, or parts of it are covered by other elements, the element is defined as invisible. For example, wait for the element's CSS attribute to go from "display:block" to "display:none" after clicking on some button. |
Command | Target | Value | Description |
---|---|---|---|
captureScreen | N/A or a locator | N/A | Captures a screenshot. If the target is a locator, the target element will be highlighted in the screenshot. |
Command | Target | Value | Description |
---|---|---|---|
IF | A JavaScript expression that returns a boolean result | N/A | Variables can be used in the expression. Example 1 (if the variable is a number): \${var_num} == 100 . Example 2 (if the variable is a string): "${var_name}" == "Guest" . In addition, one IF command should be paired with one ELSE/END command. |
ELSE | N/A | N/A | One ELSE command should be paired with one IF command and one END command. Currently, ELSE-IF is not supported. |
WHILE | A JavaScript expression that returns a boolean result | Maximum number of loops. A blank value means no maximum number restriction. | Variables can be used in the expression. Example 1 (if the variable is a number): \${var_num} == 100 . Example 2 (if the variable is a string): "${var_name}" == "Guest" . In addition, one WHILE command should be paired with one END command. |
TRY | N/A | N/A | One TRY command should be paired with one CATCH/END command. |
CATCH | N/A | N/A | One CATCH command should be paired with one TRY command and one END command. |
END | N/A | N/A | END commands should be placed at the end of IF-ELSE/WHILE/TRY-CATCH blocks. |
INCLUDE | The test case to be included while playing. Use the format: TestSuiteName.TestCaseName . For example, Test Suite 1.Test Case 1 . |
N/A | Includes other test cases. All the commands within the included test case will be executed by this command. |
COMMENT | Any | Any | A COMMENT command can be used to outline intentions for its following commands. The comment text can be written in Target or Value. COMMENT commands will be ignored during the execution of test cases. |
Command | Target | Value | Description |
---|---|---|---|
assertCSS | A locator | A CSS Rule-Set JSON string with computed CSS values. For example: {"color":"rgb(255, 255, 255)"} . |
Asserts if the CSS of the targeted element is correct. This command is implemented by getComputedStyle function. If the verification result has failed, the current test case will stop playing and the next test case will continue to be played. Variables can be used in the Value. |
assertURL | A URL | N/A or a JSON string for the fetch request. For example: { "body": "{ \\"answer\\": 42 }", "cache": "no-cache", "credentials": "same-origin", "headers": { "user-agent": "Mozilla/4.0 MDN Example", "content-type": "application/json" }, "method": "POST", "mode": "cors", "redirect": "follow", "referrer": "no-referrer" } . |
Asserts if the HTTP response status is in the range 200-299. If the verification result has failed, the current test case will stop playing and the next test case will continue to be played. Variables can be used in the Value. |
Command | Target | Value | Description |
---|---|---|---|
verifyCSS | A locator | A CSS rule-set json string with computed CSS values. For example: {"color":"rgb(255, 255, 255)"}. | Verifies if the CSS of the targeted element is correct. This command is implemented by getComputedStyle function. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
verifyURL | A URL | N/A or a JSON string for the fetch request. For example: { "body": { "answer": 42 }, "cache": "no-cache", "credentials": "same-origin", "headers": { "user-agent": "Mozilla/4.0 MDN Example", "content-type": "application/json" }, "method": "POST", "mode": "cors", "redirect": "follow", "referrer": "no-referrer" } . |
Verifies if the HTTP response status is in the range 200-299. The next command will continue to execute even if the verification result has failed. Variables can be used in the Value. |
Command | Target | Value | Description |
---|---|---|---|
setWindowSize | N/A | Width and height of the desired window size. For example: 1080,720 . |
Sets the window size of the target window. |
clearCookie | A domain that starts with http:// or https:// (prefix included) | A cookie name or N/A | Clears the designated cookie of the target domain. If the value field is empty, all cookies of the target domain will be cleared. |
setCookie | A domain that starts with http:// or https:// (prefix included) | A list of cookie names and values. For example : {"cookieName1":"cookieValue1", "xookieName2":"cookieValue2"} |
Creates cookies for the target domain. |
echo | The string to be printed in the log tab. Variables declared in the storeXXX commands or Variable tab can be used in the string. For example: Hello ${var_usr} |
N/A | Prints out some string or some variable in the log panel. |
pause | N/A | The amount of time to sleep/delay (in milliseconds). For example: 5000 means sleeping/delaying for 5 seconds. |
Delays the execution for some amount of time. |
setSpeed | N/A | 1 , 2 , 3 , 4 , or 5 . 1 is the slowest, and 5 is the fastest. |
Change the speed of the playback. |
runScript | Some Javascript expressions to be executed. For example: var a=10; var b=10; console.log(a+b); . |
The amount of time to wait before timeout (in milliseconds). Set -1 for infinite wait.Leave blank for default waiting time | Executes some JavaScript expressions. NOTE THAT: Avoid using alert() , prompt() , and confirm() in the Javascript expression. These three functions will not take effect while playing. Please use console.log() to log messages instead. |
uploadFileFromURL | A locator | The URL of the file to be uploaded | Inserts a file with a designated URL into an elememnt. Note that: this command does not support uploading a local file. Please make the file accessible from the network and fill in the Value with the URL to the file. While playing this command, if the element is an input element with type=file attribute, the onchange event handler will be triggered, otherwise the ondrop event handler will be triggered. If the file uploading is not handled by these event, remember to use the submit command to submit the form containing the element to complete the file uploading. This command is supported by Chrome, Firefox, Safari and Opera only. |
storeElements | The Xpath of the target element. For example: //h1. | The name of the variable storing the element list. For example: var_elem . |
Stores the target DOM tree elements into a local variable as a list. The variable can be used in another command’s Target or Value by surrounding it with ${} . For example, ${var_elem[i]} . The properties of the elements can also be obtained, for example, ${var_elem.length} and ${var_elem[i].innerHTML} |