--- tags: English --- <style> table thead { display: none; } table tr { margin: 1.5rem 0; display: grid !important; border-radius: 10px; border: 1px solid #cdcdcd !important; box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 1px rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12); } table tr td:before { font-weight: bold; } table th, table td { width: auto; max-width: 100%; flex-wrap: wrap; border: none !important; word-break: normal; } table tr td:nth-child(1) { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #cdcdcd !important; text-align: center; } table tr td:nth-child(2):before { content: "Target: "; } table tr td:nth-child(3):before { content: "Value: "; } table tr td:nth-child(4):before { content: "Description: "; } code { overflow-wrap: anywhere; } @-moz-document url-prefix() { li { margin-left: 20px; } } @media (min-width: 955px) { table tr { grid-template-columns: minmax(300px, 1fr) 10fr; grid-template-rows: auto auto auto; } table tr td:nth-child(1) { border-bottom: none !important; border-right: 1px solid #cdcdcd !important; grid-row: span 3; } #doc.markdown-body.container-fluid, .ui-infobar, .document-footer { margin-right: 0; max-width: unset; margin-left: calc(50vw - 388px); } #ui-toc-affix { /* left: 20px !important; */ width: auto !important; } } </style> # Commands List Click [here](https://sideex.github.io/example/example_testsuites/all_example.zip) to download all the examples. **Recorder-Generated Commands** * **[Mouse Event](#subtype_Recorder-Generated-Commands_Mouse-Event)** [clickAt](#cmd_clickAt), [doubleClickAt](#cmd_doubleClickAt), [mouseDownAt](#cmd_mouseDownAt), [mouseMoveAt](#cmd_mouseMoveAt), [mouseOut](#cmd_mouseOut), [mouseOver](#cmd_mouseOver), [mouseUpAt](#cmd_mouseUpAt), [dragAndDrop](#cmd_dragAndDrop), [dragAndDropToObject](#cmd_dragAndDropToObject), [changeCaretPosition](#cmd_changeCaretPosition), [scrollWheel](#cmd_scrollWheel), [rightClickAt](#cmd_rightClickAt), [blur](#cmd_blur) * **[Input Event](#subtype_Recorder-Generated-Commands_Input-Event)** [sendKeys](#cmd_sendKeys), [submit](#cmd_submit), [type](#cmd_type), [editContent](#cmd_editContent), [addSelection](#cmd_addSelection), [removeSelection](#cmd_removeSelection), [select](#cmd_select) * **[Prompt](#subtype_Recorder-Generated-Commands_Prompt)** [assertAlert](#cmd_assertAlert), [assertConfirmation](#cmd_assertConfirmation), [chooseOkOnNextConfirmation](#cmd_chooseOkOnNextConfirmation), [chooseCancelOnNextConfirmation](#cmd_chooseCancelOnNextConfirmation), [assertPrompt](#cmd_assertPrompt), [answerOnNextPrompt](#cmd_answerOnNextPrompt), [chooseCancelOnNextPrompt](#cmd_chooseCancelOnNextPrompt) * **[Others](#subtype_Recorder-Generated-Commands_Others)** [open](#cmd_open), [setViewportSize](#cmd_setViewportSize), [selectWindow](#cmd_selectWindow), [selectFrame](#cmd_selectFrame), [close](#cmd_close), [onsubmit](#cmd_onsubmit), [setCSS](#cmd_setCSS), [scrollTo](#cmd_scrollTo) **Right-Click-Generated Commands** * **[Assert](#subtype_Right-Click-Generated-Commands_Assert)** [assertText](#cmd_assertText), [assertTextRegex](#cmd_assertTextRegex), [assertTitle](#cmd_assertTitle), [assertValue](#cmd_assertValue), [assertVisibility](#cmd_assertVisibility), [assertTooltip](#cmd_assertTooltip), [assertIsPassword](#cmd_assertIsPassword), ~~[assertElement](#cmd_assertElement)~~, [assertPresence](#cmd_assertPresence) * **[Verify](#subtype_Right-Click-Generated-Commands_Verify)** [verifyText](#cmd_verifyText), [verifyTextRegex](#cmd_verifyTextRegex), [verifyTitle](#cmd_verifyTitle), [verifyValue](#cmd_verifyValue), [verifyVisibility](#cmd_verifyVisibility), [verifyTooltip](#cmd_verifyTooltip), [verifyIsPassword](#cmd_verifyIsPassword), ~~[verifyElement](#cmd_verifyElement)~~, [verifyPresence](#cmd_verifyPresence) * **[Store](#subtype_Right-Click-Generated-Commands_Store)** [store](#cmd_store), [storeGlobalVar](#cmd_storeGlobalVar), [storeEval](#cmd_storeEval), [storeText](#cmd_storeText), [storeTitle](#cmd_storeTitle), [storeValue](#cmd_storeValue), [storeTooltip](#cmd_storeTooltip), [storeIsVisible](#cmd_storeIsVisible), [storeElement](#cmd_storeElement) * **[Wait-For](#subtype_Right-Click-Generated-Commands_Wait-For)** [waitForElementPresent](#cmd_waitForElementPresent), [waitForElementNotPresent](#cmd_waitForElementNotPresent), [waitForElementVisible](#cmd_waitForElementVisible), [waitForElementNotVisible](#cmd_waitForElementNotVisible) * **[Others](#subtype_Right-Click-Generated-Commands_Others)** [captureScreen](#cmd_captureScreen) **Manually Written Commands** * **[Control Flow Logic](#subtype_Manually-Written-Commands_Control-Flow-Logic)** [IF](#cmd_IF), [ELSE](#cmd_ELSE), [WHILE](#cmd_WHILE), [TRY](#cmd_TRY), [CATCH](#cmd_CATCH), [END](#cmd_END), [INCLUDE](#cmd_INCLUDE), [COMMENT](#cmd_COMMENT) * **[Assert](#subtype_Manually-Written-Commands_Assert)** [assertCSS](#cmd_assertCSS), [assertURL](#cmd_assertURL) * **[Verify](#subtype_Manually-Written-Commands_Verify)** [verifyCSS](#cmd_verifyCSS), [verifyURL](#cmd_verifyURL) * **[Others](#subtype_Manually-Written-Commands_Others)** [setWindowSize](#cmd_setWindowSize), [clearCookie](#cmd_clearCookie), [setCookie](#cmd_setCookie), [echo](#cmd_echo), [pause](#cmd_pause), [setSpeed](#cmd_setSpeed), [runScript](#cmd_runScript), [uploadFileFromURL](#cmd_uploadFileFromURL), [storeElements](#cmd_storeElements) --- # Recorder-Generated Commands ## <span id="subtype_Recorder-Generated-Commands_Mouse-Event">Mouse Event</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_clickAt">clickAt</span>](https://sideex.github.io/example/example_testsuites/clickAt_example.zip) | 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. [<span id="cmd_doubleClickAt">doubleClickAt</span>](https://sideex.github.io/example/example_testsuites/doubleClickAt_example.zip) | 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. <span id="cmd_mouseDownAt">mouseDownAt</span> | 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. <span id="cmd_mouseMoveAt">mouseMoveAt</span> | 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. <li>Supposely, a sequence of recorded mouseMoveAt commands is preceded by a mouseDownAt command, and the first movement's OX and OY of each command is relative to the last movement of the previous command.</li><li>If a sequence of mouseMoveAt commands is not preceded by a mouseDownAt command, the OX and OY of the first movement of each command is relative to position (0,0) of the page.</li> [<span id="cmd_mouseOut">mouseOut</span>](https://sideex.github.io/example/example_testsuites/mouseOver&mouseOut_example.zip) | A locator | N/A | Triggers a mouseOut event on a targeted element. [<span id="cmd_mouseOver">mouseOver</span>](https://sideex.github.io/example/example_testsuites/mouseOver&mouseOut_example.zip) | 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. <span id="cmd_mouseUpAt">mouseUpAt</span> | 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. [<span id="cmd_dragAndDrop">dragAndDrop</span>](https://sideex.github.io/example/example_testsuites/dragAndDrop_example.zip) | 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. [<span id="cmd_dragAndDropToObject">dragAndDropToObject</span>](https://sideex.github.io/example/example_testsuites/dragAndDropToObject_example.zip) | 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. [<span id="cmd_changeCaretPosition">changeCaretPosition</span>](https://sideex.github.io/example/example_testsuites/changeCaretPosition_example.zip) | 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. <span id="cmd_scrollWheel">scrollWheel</span> | 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. [<span id="cmd_rightClickAt">rightClickAt</span>](https://sideex.github.io/example/example_testsuites/rightClickAt_example.zip) | A locator | x,y position of the mouse event relative to the target element. For example: `10,10`. | Right-clicks on a targeted element. [<span id="cmd_blur">blur</span>](https://sideex.github.io/example/example_testsuites/blur_example.zip) | A locator | x,y position of the mouse event relative to the target element. For example: `10,10`. | Right-clicks on a targeted element. ## <span id="subtype_Recorder-Generated-Commands_Input-Event">Input Event</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_sendKeys">sendKeys</span>](https://sideex.github.io/example/example_testsuites/sendkeys_example.zip) | A locator | N/A | Triggers a blur event that will unfocus from the target element. [<span id="cmd_submit">submit</span>](https://sideex.github.io/example/example_testsuites/submit_example.zip) | The locator of the form to be submitted | N/A | Submits a form. [<span id="cmd_type">type</span>](https://sideex.github.io/example/example_testsuites/type_example.zip) | 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`. [<span id="cmd_editContent">editContent</span>](https://sideex.github.io/example/example_testsuites/editContent_example.zip) | 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. [<span id="cmd_addSelection">addSelection</span>](https://sideex.github.io/example/example_testsuites/addSelection_example.zip) | A locator of a multi-select box | `label=option_value` | Adds a selection of an option in a multi-select box. [<span id="cmd_removeSelection">removeSelection</span>](https://sideex.github.io/example/example_testsuites/removeSelection_example.zip) | A locator of a multi-select box | `label=option_value` | Removes an option from a multi-select box. [<span id="cmd_select">select</span>](https://sideex.github.io/example/example_testsuites/select_example.zip) | A locator of a drop-down menu | `label=option_value` | Selects an element of a drop-down menu. ## <span id="subtype_Recorder-Generated-Commands_Prompt">Prompt</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_assertAlert">assertAlert</span>](https://sideex.github.io/example/example_testsuites/assertAlert_example.zip) | The expected alert message | N/A | Asserts if the message on the alert window is correct. [<span id="cmd_assertConfirmation">assertConfirmation</span>](https://sideex.github.io/example/example_testsuites/assertConfirmation_example.zip) | The expected confirmation message | N/A | Asserts if the message on the confirmation window is correct. [<span id="cmd_chooseOkOnNextConfirmation">chooseOkOnNextConfirmation</span>](https://sideex.github.io/example/example_testsuites/chooseOkOnNextConfirmation_example.zip) | N/A | N/A | Chooses `Ok` on the confirmation window that will pop up. Make sure this command appears before the `assertConfirmation` command. [<span id="cmd_chooseCancelOnNextConfirmation">chooseCancelOnNextConfirmation</span>](https://sideex.github.io/example/example_testsuites/chooseCancelOnNextConfirmation_example.zip) | N/A | N/A | Chooses `Cancel` on the confirmation window that will pop up. Make sure this command appears before the `assertConfirmation` command. [<span id="cmd_assertPrompt">assertPrompt</span>](https://sideex.github.io/example/example_testsuites/assertPrompt_example.zip) | The expected prompt message | N/A | Asserts if the message on the prompt window is correct. [<span id="cmd_answerOnNextPrompt">answerOnNextPrompt</span>](https://sideex.github.io/example/example_testsuites/answerOnNextPrompt_example.zip) | 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. [<span id="cmd_chooseCancelOnNextPrompt">chooseCancelOnNextPrompt</span>](https://sideex.github.io/example/example_testsuites/chooseCancelOnNextPrompt_example.zip) | N/A | N/A | Chooses 'cancel' on the prompt window that will pop up. Make sure this command appears before the `assertPrompt` command. ## <span id="subtype_Recorder-Generated-Commands_Others">Others</span> :::danger :fire: Please do not attempt adding these commands manually unless you know what you are doing! ::: Command | Target | Value | Description -|-|-|- [<span id="cmd_open">open</span>](https://sideex.github.io/example/example_testsuites/open&close_example.zip) | A URL | N/A | Opens a webpage according to the target URL. <span id="cmd_setViewportSize">setViewportSize</span> | 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. <span id="cmd_selectWindow">selectWindow</span> | Auto-generated | N/A | Selects the target window. This command is intended to be auto-generated while recording. <span id="cmd_selectFrame">selectFrame</span> | <li>A locator</li><li>`index=i` (select the i-th frame, i starts from 0)</li><li>`relative=parent` (Select the parent frame)</li><li>`relative=top` (select the top frame)</li> | N/A | Selects the target frame. This command is intended to be auto-generated while recording. [<span id="cmd_close">close</span>](https://sideex.github.io/example/example_testsuites/open&close_example.zip) | Auto-generated | N/A | Closes the target window. This command is intended to be auto-generated while recording. [<span id="cmd_onsubmit">onsubmit</span>](https://sideex.github.io/example/example_testsuites/onsubmit_example.zip) | 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. [<span id="cmd_setCSS">setCSS</span>](https://sideex.github.io/example/example_testsuites/setcss_example.zip) | 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);` <span id="cmd_scrollTo">scrollTo</span> | 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. --- # Right-Click-Generated Commands ## <span id="subtype_Right-Click-Generated-Commands_Assert">Assert</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_assertText">assertText</span>](https://sideex.github.io/example/example_testsuites/assertText_example.zip) | 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. [<span id="cmd_assertTextRegex">assertTextRegex</span>](https://sideex.github.io/example/example_testsuites/assertTextRegex_example.zip) | 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. [<span id="cmd_assertTitle">assertTitle</span>](https://sideex.github.io/example/example_testsuites/assertTitle_example.zip) | 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. [<span id="cmd_assertValue">assertValue</span>](https://sideex.github.io/example/example_testsuites/assertValue_example.zip) | 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. [<span id="cmd_assertVisibility">assertVisibility</span>](https://sideex.github.io/example/example_testsuites/assertVisibility_example.zip) | 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. [<span id="cmd_assertTooltip">assertTooltip</span>](https://sideex.github.io/example/example_testsuites/assertTooltip_example.zip) | 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. [<span id="cmd_assertIsPassword">assertIsPassword</span>](https://sideex.github.io/example/example_testsuites/assertIsPassword_example.zip) | 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. |<div>~~[<span id="cmd_assertElement">assertElement</span>]~~ [Deprecated] <br> (Please use [assertPresence](#cmd_assertPresence)) </div> | 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.| [<span id="cmd_assertPresence">assertPresence</span>](https://sideex.github.io/example/example_testsuites/assertPresence_example.zip) | 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. ## <span id="subtype_Right-Click-Generated-Commands_Verify">Verify</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_verifyText">verifyText</span>](https://sideex.github.io/example/example_testsuites/verifyText_example.zip) | 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. [<span id="cmd_verifyTextRegex">verifyTextRegex</span>](https://sideex.github.io/example/example_testsuites/verifyTextRegex_example.zip) | 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. [<span id="cmd_verifyTitle">verifyTitle</span>](https://sideex.github.io/example/example_testsuites/verifyTitle_example.zip) | 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. [<span id="cmd_verifyValue">verifyValue</span>](https://sideex.github.io/example/example_testsuites/verifyValue_example.zip) | 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. [<span id="cmd_verifyVisibility">verifyVisibility</span>](https://sideex.github.io/example/example_testsuites/verifyVisibility_example.zip) | 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. [<span id="cmd_verifyTooltip">verifyTooltip</span>](https://sideex.github.io/example/example_testsuites/verifyTooltip_example.zip) | 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. [<span id="cmd_verifyIsPassword">verifyIsPassword</span>](https://sideex.github.io/example/example_testsuites/verifyIsPassword_example.zip) | 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. |<div>~~[<span id="cmd_verifyElement">verifyElement</span>]~~ [Deprecated] <br> (Please use [verifyPresence](#cmd_verifyPresence)) </div> | 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.| [<span id="cmd_verifyPresence">verifyPresence</span>](https://sideex.github.io/example/example_testsuites/verifyPresence_example.zip) | 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. ## <span id="subtype_Right-Click-Generated-Commands_Store">Store</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_store">store</span>](https://sideex.github.io/example/example_testsuites/store_example.zip) | 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}`. [<span id="cmd_storeGlobalVar">storeGlobalVar</span>](https://sideex.github.io/example/example_testsuites/storeGlobalVar_example.zip) | 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}`. [<span id="cmd_storeEval">storeEval</span>](https://sideex.github.io/example/example_testsuites/storeEval_example.zip) | 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. | 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}`. [<span id="cmd_storeText">storeText</span>](https://sideex.github.io/example/example_testsuites/storeText_example.zip) | 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}`. [<span id="cmd_storeTitle">storeTitle</span>](https://sideex.github.io/example/example_testsuites/storeTitle_example.zip) | 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}`. [<span id="cmd_storeValue">storeValue</span>](https://sideex.github.io/example/example_testsuites/storeValue_example.zip) | 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}`. [<span id="cmd_storeTooltip">storeTooltip</span>](https://sideex.github.io/example/example_testsuites/storeTooltip_example.zip) | 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}`. [<span id="cmd_storeIsVisible">storeIsVisible</span>](https://sideex.github.io/example/example_testsuites/storeIsVisible_example.zip) | 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}`. [<span id="cmd_storeElement">storeElement</span>](https://sideex.github.io/example/example_testsuites/storeElement_example.zip) | 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:<li>For using `${var_elem}` in `runScript` and `storeEval` commands, the target element in DOM tree will be referenced. For example, when running `runScript ## <span id="subtype_Right-Click-Generated-Commands_Wait-For">Wait-For</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_waitForElementPresent">waitForElementPresent</span>](https://sideex.github.io/example/example_testsuites/waitForElementPresent_example.zip) | 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. [<span id="cmd_waitForElementNotPresent">waitForElementNotPresent</span>](https://sideex.github.io/example/example_testsuites/waitForElementNotPresent_example.zip) | 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. [<span id="cmd_waitForElementVisible">waitForElementVisible</span>](https://sideex.github.io/example/example_testsuites/waitForElementVisible_example.zip) | 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. [<span id="cmd_waitForElementNotVisible">waitForElementNotVisible</span>](https://sideex.github.io/example/example_testsuites/waitForElementNotVisible_example.zip) | 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. ## <span id="subtype_Right-Click-Generated-Commands_Others">Others</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_captureScreen">captureScreen</span>](https://sideex.github.io/example/example_testsuites/captureScreen_example.zip) | 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. --- # Manually Written Commands ## <span id="subtype_Manually-Written-Commands_Control-Flow-Logic">Control Flow Logic</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_IF">IF</span>](https://sideex.github.io/example/example_testsuites/IF_ELSE_example.zip) | 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. [<span id="cmd_ELSE">ELSE</span>](https://sideex.github.io/example/example_testsuites/IF_ELSE_example.zip) | N/A | N/A | One ELSE command should be paired with one IF command and one END command. Currently, ELSE-IF is not supported. [<span id="cmd_WHILE">WHILE</span>](https://sideex.github.io/example/example_testsuites/WHILE_example.zip) | 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. [<span id="cmd_TRY">TRY</span>](https://sideex.github.io/example/example_testsuites/TRY_CATCH_example.zip) | N/A | N/A | One TRY command should be paired with one CATCH/END command. [<span id="cmd_CATCH">CATCH</span>](https://sideex.github.io/example/example_testsuites/TRY_CATCH_example.zip) | N/A | N/A | One CATCH command should be paired with one TRY command and one END command. <span id="cmd_END">END</span> | N/A | N/A | END commands should be placed at the end of IF-ELSE/WHILE/TRY-CATCH blocks. [<span id="cmd_INCLUDE">INCLUDE</span>](https://sideex.github.io/example/example_testsuites/Include_example.zip) | 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. <span id="cmd_COMMENT">COMMENT</span> | 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. ## <span id="subtype_Manually-Written-Commands_Assert">Assert</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_assertCSS">assertCSS</span>](https://sideex.github.io/example/example_testsuites/assertCSS_example.zip) | A locator | A [CSS Rule-Set](https://hackmd.io/@sideex/computed-css-values) 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. [<span id="cmd_assertURL">assertURL</span>](https://sideex.github.io/example/example_testsuites/assertURL_example.zip) | A URL | N/A or a JSON string for the [fetch request](https://developer.mozilla.org/en-US/docs/Web/API/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. ## <span id="subtype_Manually-Written-Commands_Verify">Verify</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_verifyCSS">verifyCSS</span>](https://sideex.github.io/example/example_testsuites/verifyCSS_example.zip) | A locator | A [CSS rule-set](https://hackmd.io/@sideex/computed-css-values) 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. [<span id="cmd_verifyURL">verifyURL</span>](https://sideex.github.io/example/example_testsuites/verifyURL_example.zip) | A URL | N/A or a JSON string for the [fetch request](https://developer.mozilla.org/en-US/docs/Web/API/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. ## <span id="subtype_Manually-Written-Commands_Others">Others</span> Command | Target | Value | Description -|-|-|- [<span id="cmd_setWindowSize">setWindowSize</span>](https://sideex.github.io/example/example_testsuites/setwindowsize_example.zip) | N/A | Width and height of the desired window size. For example: `1080,720`. | Sets the window size of the target window. <span id="cmd_clearCookie">clearCookie</span> | 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. <span id="cmd_setCookie">setCookie</span> | 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. [<span id="cmd_echo">echo</span>](https://sideex.github.io/example/example_testsuites/echo_example.zip) | 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. [<span id="cmd_pause">pause</span>](https://sideex.github.io/example/example_testsuites/pause_example.zip) | 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. [<span id="cmd_setSpeed">setSpeed</span>](https://sideex.github.io/example/example_testsuites/setSpeed_example.zip) | N/A | `1`, `2`, `3`, `4`, or `5`. `1` is the slowest, and `5` is the fastest. | Change the speed of the playback. [<span id="cmd_runScript">runScript</span>](https://sideex.github.io/example/example_testsuites/runscript_example.zip) | 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. [<span id="cmd_uploadFileFromURL">uploadFileFromURL</span>](https://sideex.github.io/example/example_testsuites/uploadFileFromURL_example.zip) | 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. <br>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. [<span id="cmd_storeElements">storeElements</span>](https://sideex.github.io/example/example_testsuites/storeElements_example.zip) | 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}`