Commands
The commands of the step editor, grouped by purpose, with what goes in their Target and Value fields.
In the step editor, hover over the Command field to see the description of the selected command. The argument types are described in Arguments.
Note:
open application, close application, click and type, click nearby region and git bash transaction — for Mugnsoft GUI tests. Pulse skips them in local playback and reports the run as skipped. They are not documented here yet: contact Mugnsoft support before using them.
| Group | Commands |
|---|---|
| Transactions | 2 |
| Control flow | 10 |
| Assertions | 17 |
| Verifications | 14 |
| Waits | 8 |
| Variables | 8 |
| Pop-ups and dialogs | 5 |
| Scripts and debugging | 7 |
| Browser and windows | 5 |
| Interactions | 20 |
Transactions
start transaction
Start a transaction: the steps up to the matching stop transaction are timed together when the journey runs as an EUM monitor in Mugnsoft.
- target — transaction name: The name of the transaction (e.g.: addItemToBasket).
- value — transaction value: The value assigned to that transaction. It is made up of the major threshold value, the critical threshold value, the description of the transaction (e.g. 1.2, 1.5, “add item to basket”).
stop transaction
Stop the transaction of the same name opened by start transaction.
- target — transaction name: The name of the transaction (e.g.: addItemToBasket).
Control flow
do
Create a loop that executes the proceeding commands at least once. Terminate the branch with the repeat if command.
else
Part of an if block. Execute the commands in this branch when an if and/or else if condition are not met. Terminate the branch with the end command.
else if
Part of an if block. Execute the commands in this branch when an if condition has not been met. Terminate the branch with the end command.
- target — conditional expression: JavaScript expression that returns a boolean result for use in control flow commands
end
Terminates a control flow block for if, while, and times.
for each
Create a loop that executes the proceeding commands for each item in a given collection.
- target — array variable name: The name of a variable containing a JavaScript array
- value — iterator variable name: The name of the variable used when iterating over a collection in a looping control flow command (e.g., for each)
if
Create a conditional branch in your test. Terminate the branch with the end command.
- target — conditional expression: JavaScript expression that returns a boolean result for use in control flow commands
repeat if
Terminate a ‘do’ control flow branch conditionally. If the result of the provided conditional expression is true, it starts the do loop over. Otherwise it ends the loop.
- target — conditional expression: JavaScript expression that returns a boolean result for use in control flow commands
- value — loop limit: Maximum number of times a looping control flow command can execute to protect against infinite loops
run
Runs a test case from the current project.
- target — test case: Test case name from the project
times
Create a loop that executes the proceeding commands n number of times.
- target — times: The number of attempts a times control flow loop will execute the commands within its block
- value — loop limit: Maximum number of times a looping control flow command can execute to protect against infinite loops
while
Create a loop that executes the proceeding commands repeatedly for as long as the provided conditional expression is true.
- target — conditional expression: JavaScript expression that returns a boolean result for use in control flow commands
- value — loop limit: Maximum number of times a looping control flow command can execute to protect against infinite loops
Assertions
assert
Check that a variable is an expected value. The variable’s value will be converted to a string for comparison. The test will stop if the assert fails.
- target — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
- value — expected value: The result you expect a variable to contain (e.g., true, false, or some other value)
assert alert
Confirm that an alert has been rendered with the provided text. The test will stop if the assert fails.
- target — alert text: text to check
assert checked
Confirm that the target element has been checked. The test will stop if the assert fails.
- target — locator: An element locator
assert confirmation
Confirm that a confirmation has been rendered. The test will stop if the assert fails.
- target — alert text: text to check
assert editable
Confirm that the target element is editable. The test will stop if the assert fails.
- target — locator: An element locator
assert element not present
Confirm that the target element is not present anywhere on the page. The test will stop if the assert fails.
- target — locator: An element locator
assert element present
Confirm that the target element is present somewhere on the page. The test will stop if the assert fails.
- target — locator: An element locator
assert not checked
Confirm that the target element has not been checked. The test will stop if the assert fails.
- target — locator: An element locator
assert not editable
Confirm that the target element is not editable. The test will stop if the assert fails.
- target — locator: An element locator
assert not selected value
Confirm that the value attribute of the selected option in a dropdown element does not contain the provided value. The test will stop if the assert fails.
- target — select locator: An element locator identifying a drop-down menu
- value — text: An exact string match.
assert not text
Confirm that the text of an element does not contain the provided value. The test will stop if the assert fails.
- target — locator: An element locator
- value — text: An exact string match.
assert prompt
Confirm that a JavaScript prompt has been rendered. The test will stop if the assert fails.
- target — alert text: text to check
assert selected label
Confirm that the label of the selected option in a dropdown element contains the provided value. The test will stop if the assert fails.
- target — select locator: An element locator identifying a drop-down menu
- value — text: An exact string match.
assert selected value
Confirm that the value attribute of the selected option in a dropdown element contains the provided value. The test will stop if the assert fails.
- target — select locator: An element locator identifying a drop-down menu
- value — text: An exact string match.
assert text
Confirm that the text of an element contains the provided value. The test will stop if the assert fails.
- target — locator: An element locator
- value — text: An exact string match.
assert title
Confirm the title of the current page contains the provided text. The test will stop if the assert fails.
- target — text: An exact string match.
assert value
Confirm the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be “on” or “off” depending on whether the element is checked or not. The test will stop if the assert fails.
- target — locator: An element locator
- value — text: An exact string match.
Verifications
verify
Soft assert that a variable is an expected value. The variable’s value will be converted to a string for comparison. The test will continue even if the verify fails.
- target — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
- value — expected value: The result you expect a variable to contain (e.g., true, false, or some other value)
verify checked
Soft assert that a toggle-button (checkbox/radio) has been checked. The test will continue even if the verify fails.
- target — locator: An element locator
verify editable
Soft assert whether the specified input element is editable (e.g., hasn’t been disabled). The test will continue even if the verify fails.
- target — locator: An element locator
verify element not present
Soft assert that the specified element is not somewhere on the page. The test will continue even if the verify fails.
- target — locator: An element locator
verify element present
Soft assert that the specified element is somewhere on the page. The test will continue even if the verify fails.
- target — locator: An element locator
verify not checked
Soft assert that a toggle-button (checkbox/radio) has not been checked. The test will continue even if the verify fails.
- target — locator: An element locator
verify not editable
Soft assert whether the specified input element is not editable (e.g., has been disabled). The test will continue even if the verify fails.
- target — locator: An element locator
verify not selected value
Soft assert that the expected element has not been chosen in a select menu by its option attribute. The test will continue even if the verify fails.
- target — select locator: An element locator identifying a drop-down menu
- value — option: An option locator, typically just an option label (e.g. “John Smith”)
verify not text
Soft assert the text of an element is not present. The test will continue even if the verify fails.
- target — locator: An element locator
- value — text: The text to verify
verify selected label
Soft assert the visible text for a selected option in the specified select element. The test will continue even if the verify fails.
- target — select locator: An element locator identifying a drop-down menu
- value — text: An exact string match.
verify selected value
Soft assert that the expected element has been chosen in a select menu by its option attribute. The test will continue even if the verify fails.
- target — select locator: An element locator identifying a drop-down menu
- value — option: An option locator, typically just an option label (e.g. “John Smith”)
verify text
Soft assert the text of an element is present. The test will continue even if the verify fails.
- target — locator: An element locator
- value — text: The text to verify
verify title
Soft assert the title of the current page contains the provided text. The test will continue even if the verify fails.
- target — text: The text to verify
verify value
Soft assert the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be “on” or “off” depending on whether the element is checked or not. The test will continue even if the verify fails.
- target — locator: An element locator
- value — text: An exact string match.
Waits
pause
Wait for the specified amount of time.
- target — wait time: The amount of time to wait (in milliseconds)
wait for element editable
Wait for an element to be editable.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for element not editable
Wait for an element to not be editable.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for element not present
Wait for a target element to not be present on the page.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for element not visible
Wait for a target element to not be visible on the page.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for element present
Wait for a target element to be present on the page.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for element visible
Wait for a target element to be visible on the page.
- target — locator: An element locator
- value — wait time: The amount of time to wait (in milliseconds)
wait for text
Wait until the text of an element is present
- target — locator: An element locator
- value — text: The text to verify
Variables
store
Save a target string as a variable for easy re-use.
- target — text: The text to verify
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store attribute
Gets the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the “style” attribute, for example).
- target — attribute locator: An element locator followed by an @ sign and then the name of the attribute, e.g. “foo@bar”
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store element count
Gets the number of nodes that match the specified locator (e.g. “xpath=//table” would give the number of tables).
- target — locator: An element locator
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store json
Ssave JSON as an object on a variable
- target — json: A string representation of a JavaScript object
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store text
Gets the text of an element and stores it for later use. This works for any element that contains text.
- target — locator: An element locator
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store title
Gets the title of the current page.
- target — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store value
Gets the value of element and stores it for later use. This works for any input type element.
- target — locator: An element locator
- value — variable name: The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
store window handle
Gets the handle of the current page.
- target — window handle: A handle representing a specific page (tab, or window)
Pop-ups and dialogs
accept alert
Affects a currently showing alert. This command instructs Pulse to accept it.
accept confirmation
Affects a currently showing confirmation alert. This command instructs Pulse to accept it.
answer prompt
Affects a currently showing alert prompt. This command instructs Pulse to provide the specified answer to it.
- target — answer: The answer to give in response to the prompt pop-up
dismiss confirmation
Affects a currently showing confirmation alert. This command instructs Pulse to dismiss it.
dismiss prompt
Affects a currently showing alert prompt. This command instructs Pulse to dismiss it.
Scripts and debugging
debugger
Breaks the execution and enters debugger
echo
Prints the specified message. Useful for debugging.
- target — message: The message to print
execute async script
Executes an async snippet of JavaScript in the context of the currently selected frame or window. The script fragment will be executed as the body of an anonymous function and must return a Promise. The Promise result will be saved on the variable if you use the ‘return’ keyword.
- target — script: The JavaScript snippet to run
- value — variable name (optional): The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
execute script
Executes a snippet of JavaScript in the context of the currently selected frame or window. The script fragment will be executed as the body of an anonymous function. To store the return value, use the ‘return’ keyword and provide a variable name in the value input field.
- target — script: The JavaScript snippet to run
- value — variable name (optional): The name of a variable (without brackets). Used to either store an expression’s result in or reference for a check (e.g., with ‘assert’ or ‘verify’)
free text
Add free text or code that is passed as-is to the generated Mugnsoft script. A test whose first command is free text is deployed as a GUI test.
- value — free text value: The functions in the free text value to execute in order.
run script
Creates a new “script” tag in the body of the current test window, and adds the specified text into the body of the command. Beware that JS exceptions thrown in these script tags aren’t managed by Pulse, so you should probably wrap your script in try/catch blocks if there is any chance that the script will throw an exception.
- target — script: The JavaScript snippet to run
set speed
Set execution speed (e.g., set the millisecond length of a delay which will follow each command). By default, there is no such delay, e.g., the delay is 0 milliseconds. This setting is global, and will affect all test runs, until changed.
- target — wait time: The amount of time to wait (in milliseconds)
Browser and windows
close
Closes the current window. There is no need to close the initial window, Pulse re-uses it; closing it may cause a performance penalty on the test.
open
Opens a URL and waits for the page to load before proceeding. This accepts both relative and absolute URLs.
- target — url: The URL to open (may be relative or absolute)
select frame
Selects a frame within the current window. You may invoke this command multiple times to select a nested frame. NOTE: To select the parent frame, use “relative=parent” as a locator. To select the top frame, use “relative=top”. You can also select a frame by its 0-based index number (e.g., select the first frame with “index=0”, or the third frame with “index=2”).
- target — locator: An element locator
select window
Selects a popup window using a window locator. Once a popup window has been selected, all commands will go to that window. Window locators use handles to select windows.
- target — window handle: A handle representing a specific page (tab, or window)
set window size
Set the browser’s window size, including the browser’s interface.
- target — resolution: Specify a window resolution using WidthxHeight. (e.g., 1280x800)
Interactions
add selection
Add a selection to the set of options in a multi-select element.
- target — locator: An element locator
check
Check a toggle-button (checkbox/radio).
- target — locator: An element locator
click
Clicks on a target element (e.g., a link, button, checkbox, or radio button).
- target — locator: An element locator
click at
Clicks on a target element (e.g., a link, button, checkbox, or radio button). The coordinates are relative to the target element (e.g., 0,0 is the top left corner of the element) and are mostly used to check effects that relay on them, for example the material ripple effect.
- target — locator: An element locator
- value — coord string: Specifies the x,y position (e.g., - 10,20) of the mouse event relative to the element found from a locator
double click
Double clicks on an element (e.g., a link, button, checkbox, or radio button).
- target — locator: An element locator
double click at
Double clicks on a target element (e.g., a link, button, checkbox, or radio button). The coordinates are relative to the target element (e.g., 0,0 is the top left corner of the element) and are mostly used to check effects that relay on them, for example the material ripple effect.
- target — locator: An element locator
- value — coord string: Specifies the x,y position (e.g., - 10,20) of the mouse event relative to the element found from a locator
drag and drop to object
Drags an element and drops it on another element.
- target — locator of object to be dragged: The locator of element to be dragged
- value — locator of drag destination object: The locator of an element whose location (e.g., the center-most pixel within it) will be the point where locator of object to be dragged is dropped
edit content
Sets the value of a content editable element as if you typed in it.
- target — locator: An element locator
- value — value: The value to type
mouse down
Simulates a user pressing the left mouse button (without releasing it yet).
- target — locator: An element locator
mouse down at
Simulates a user pressing the left mouse button (without releasing it yet) at the specified location.
- target — locator: An element locator
- value — coord string: Specifies the x,y position (e.g., - 10,20) of the mouse event relative to the element found from a locator
mouse move at
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
- target — locator: An element locator
- value — coord string: Specifies the x,y position (e.g., - 10,20) of the mouse event relative to the element found from a locator
mouse out
Simulates a user moving the mouse pointer away from the specified element.
- target — locator: An element locator
mouse over
Simulates a user hovering a mouse over the specified element.
- target — locator: An element locator
mouse up
Simulates the event that occurs when the user releases the mouse button (e.g., stops holding the button down).
- target — locator: An element locator
mouse up at
Simulates the event that occurs when the user releases the mouse button (e.g., stops holding the button down) at the specified location.
- target — locator: An element locator
- value — coord string: Specifies the x,y position (e.g., - 10,20) of the mouse event relative to the element found from a locator
remove selection
Remove a selection from the set of selected options in a multi-select element using an option locator.
- target — locator: An element locator
- value — option: An option locator, typically just an option label (e.g. “John Smith”)
select
Select an element from a drop-down menu using an option locator. Option locators provide different ways of specifying a select element (e.g., label=, value=, id=, index=). If no option locator prefix is provided, a match on the label will be attempted.
- target — select locator: An element locator identifying a drop-down menu
- value — option: An option locator, typically just an option label (e.g. “John Smith”)
send keys
Simulates keystroke events on the specified element, as though you typed the value key-by-key. This simulates a real user typing every character in the specified string; it is also bound by the limitations of a real user, like not being able to type into a invisible or read only elements. This is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events. Unlike the simple “type” command, which forces the specified value into the page directly, this command will not replace the existing content.
- target — locator: An element locator
- value — key sequence: A sequence of keys to type, can be used to send key strokes (e.g. ${KEY_ENTER})
type
Sets the value of an input field, as though you typed it in. Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text. Chrome only: If a file path is given it will be uploaded to the input (for type=file), NOTE: XPath locators are not supported.
- target — locator: An element locator
- value — value: The value to type
uncheck
Uncheck a toggle-button (checkbox/radio).
- target — locator: An element locator
See also
- Arguments — the argument types used by these commands
- Control flow — conditions and loops with examples
- Transactions — time groups of steps in Mugnsoft