Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SyntaxAction

i should be on "<url>"

Will check if the browser is on the specified url.
pause

Will show a dialog and only continue execution when the OK button in the dialog is pressed.

Useful for pausing the feature and executing some manual actions in the browser.

wait for <number> ms

i wait for <number> ms

Will wait the number of milliseconds before going to the next step.

wait until <descriptor> is visible

i wait for <number> ms until <descriptor> is visible

i wait for <number> ms or until <descriptor> is visible

Will wait the specified number of milliseconds or until the specified element is visible, whichever comes first.

If the number of milliseconds is omitted, then the maximum wait time will be 10 seconds. If the maximum wait time is reached, this step will fail.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

wait until <descriptor> exists

i wait for <number> ms until <descriptor> exists

i wait for <number> ms or until <descriptor> exists

Will wait the specified number of milliseconds or until the specified element is found in the DOM, whichever comes first.

If the number of milliseconds is omitted, then the maximum wait time will be 10 seconds. If the maximum wait time is reached, this step will fail.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

wait until <descriptor> is not visible

i wait for <number> ms until <descriptor> is not visible

i wait for <number> ms or until <descriptor> is not visible

Will wait the specified number of milliseconds or until the specified element is not visible, whichever comes first.

If the number of milliseconds is omitted, then the maximum wait time will be 10 seconds. If the maximum wait time is reached, this step will fail.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

wait until <descriptor> does not exist

i wait for <number> ms until <descriptor> does not exist

i wait for <number> ms or until <descriptor> does not exist

Will wait the specified number of milliseconds or until the specified element is no longer found in the DOM, whichever comes first.

If the number of milliseconds is omitted, then the maximum wait time will be 10 seconds. If the maximum wait time is reached, this step will fail.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

highlight <descriptor>

i highlight <descriptor>

Will highlight the element for a very short while and will pause the execution (see pause step above).

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

focus on <descriptor>

i focus on <descriptor>

i put the focus on <descriptor>

Will put the browser focus on the element matching the descriptor.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

remove focus from <descriptor>

i remove focus from <descriptor>

Will remove the browser focus from the element matching the descriptor.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

Warning

The support for this seems to be very limited (SAHI and browser related), in most cases it is probably better to explicitly put the focus on a different element instead.

This does seem to be the only way to really trigger a focusout event.

i should see "<message>"

Will verify that the message is present in the page (body of the document); does not check actual visibility.

Warning

Avoid the use of this step, prefer using a specific step checking the visibility of an element or if an element contains a certain value.

This step is deprecated and will be removed in the future.

i should not see "<message>"

Will verify that the message is not present in the page (body of the document); does not check actual visibility.

Warning

Avoid the use of this step, prefer using a specific step checking the visibility of an element or if an element contains a certain value.

This step is deprecated and will be removed in the future.

i see <descriptor>

i should see <descriptor>

<descriptor> is visible

<descriptor> should be visible

Checks that a given element is visible.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

Warning

In rare cases this check fails even though the element is visible. It has been known to fail with table cells.

<descriptor> exists

<descriptor> should exist

Checks that a given element is present in the DOM.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

i do not see <descriptor>

i should not see <descriptor>

<descriptor> is not visible

<descriptor> should not be visible

Checks that a given element is not visible. This performs the sahi check (javascript/css visibility).

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

<descriptor> does not exist

<descriptor> should not exist

Checks that a given element is not present in the DOM.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

the following elements are visible:

the following elements should be visible:

the following elements in <descriptor> are visible:

the following elements in <descriptor> should be visible:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that all elements in the table are visible. Variation: the keyword elements can also be replaced with fields.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

the following elements exist:

the following elements should exist:

the following elements in <descriptor> exist:

the following elements in <descriptor> should exist:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that all elements in the table exist in the DOM.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

the following elements are not visible:

the following elements should not be visible:

the following elements in <descriptor> are not visible:

the following elements in <descriptor> should not be visible:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that none of the elements in the table are visible. Variation: the keyword elements can also be replaced with fields.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

the following elements do not exist:

the following elements should not exist:

the following elements in <descriptor> do not exist:

the following elements in <descriptor> should not exist:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that none of the elements in the table exist in the DOM.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

 

the <field> field should contain <value>

Will verify that the text type input field value is equal to the value specified.

Warning

Prefer using the more general step <descriptor> should contain <value>.

<descriptor> should contain "<value>"

<descriptor> contains "<value>"

 

Verifies that the given element contains the value anywhere in its text.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

Info

There are multiple variants on this statement:

equals, should equal, isChecks for full equality.
starts with, should start withChecks the text starts with the given value.
ends with, should end withChecks the text ends with the given value.
matches, should matchChecks the text matches the regular expression specified by the value.

<descriptor> should not contain <value>

<descriptor> does not contain <value>

Verifies that the given element does not contain the value anywhere in its text.

The descriptor can always be replaced with a parent version: <descriptor> in <descriptor>.

Info

There are multiple variants on this statement:

does not equal, should not equal, is notChecks the text does not equal the given value.
does not start with, should not start withChecks the text does not start with the given value.
does not end with, should not end withChecks the text does not end with the given value.
does not match, should not matchChecks the text does not match the regular expression specified by the value.

the element values contain:

the element values should contain:

the element values in <descriptor> contain:

the element values in <descriptor> should contain:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that all elements in the table contain the value anywhere in their text.

Info

There are also multiple variants on this statement:

The keyword element can be substituted with field. The action (contain/should contain) can be substituted with:

equal, are, should be, should equalChecks the text equals the given value.
start with, should start withChecks the text starts with the given value.
end with, should end withChecks the text ends with the given value.
match, should matchChecks the text matches the regular expression specified by the value.

the element values do not contain:

the element values should not contain:

the element values in <descriptor> do not contain:

the element values in <descriptor> should not contain:

This statement should be followed by a table structure of the following form:

Code Block
| locator   | type      | value   |
| <locator> | <element> | <value> |

This step verifies that no element in the table contains the value anywhere in its text.

Info

There are also multiple variants on this statement:

The keyword element can be substituted with field. The action (do not contain/should not contain) can be substituted with:

do not equal, are not, should not be, should not equalChecks the text does not equal the given value.
do not start with, should not start withChecks the text does not start with the given value.
do not end with, should not end withChecks the text does not end with the given value.
do not match, should not matchChecks the text does not match the regular expression specified by the value.

<value> should be selected in <descriptor>

<value> should be selected in <descriptor> in <descriptor>

Will verify a value is selected in a specified dropdown.

The element part of the first descriptor can be omitted and select will be assumed.

<descriptor> should be chosen

<descriptor> should be chosen in <descriptor>

Will verify a radiobutton is selected.

The element part of the first descriptor can be omitted and radio will be assumed.

<descriptor> should be checked

<descriptor> should be checked in <descriptor>

Will verify a checkbox is checked.

The element part of the first descriptor can be omitted and checkbox will be assumed.

<descriptor> should be unchecked

<descriptor> should be unchecked in <descriptor>

Will verify a checkbox is unchecked.

The element part of the first descriptor can be omitted and checkbox will be assumed.

ensure that <el statement>Will verify that the el statement evaluates to a boolean True.
ensure that <first> equals <second>Will verify that the outcome of first value (string, variable or el statement) equals the second.

ensure that <object> contains <property>

ensure that <object> contains <property> with <value>

ensure that <object> contains:

Checks that a certain object contains properties. This can be a variable that is previously declared, or the result of a REST call or anything else that translates into an object.

Code Block
ensure that "#{myvariable}" contains "code"
ensure that "#{myvariable}" contains "code" with value "1234"
ensure that "#{myvariable}" contains:
| code |
ensure that "#{myvariable}" contains:
| code | 1234 |

<descriptor> should have attribute "<attributeName>"

<descriptor> has attribute "<attributeName>"

<descriptor> has the following attributes:

| <attributeName> |

<descriptor> should have the following attributes:

| <attributeName> |


Will verify a DOM attribute is present.

Make sure you use the Javascript/DOM name in case an attribute is not found but expected to be.

<descriptor> should not have attribute "<attributeName>"

<descriptor> does not have attribute "<attributeName>"

<descriptor> should not have the following attributes:

| <attributeName> |

<descriptor> does not have the following attributes:

| <attributeName> |

Will verify a DOM attribute is not present.

Make sure you use the Javascript/DOM name in case an attribute is not found but expected to be.

<descriptor> should have attribute "<attributeName>" with value "<value>"

<descriptor> has attribute "<attributeName>" with value "<value>"

<descriptor> has the following attributes:

| <attributeName> | <value> |

<descriptor> should have the following attributes:

| <attributeName> | <value> |


Will verify a DOM attribute has a specific value. An empty value will simply perform an existence check for that attribute.

Make sure you use the Javascript/DOM name in case an attribute is not found but expected to be.

<descriptor> should not have attribute "<attributeName>" with value "<value>"

<descriptor> does not have attribute "<attributeName>" with value "<value>"

<descriptor> does not have the following attributes:

| <attributeName> | <value> |

<descriptor> should not have the following attributes:

| <attributeName> | <value> |

Will verify a DOM attribute does not have a specific value. An empty value will simply perform an existence check for that attribute.

Make sure you use the Javascript/DOM name in case an attribute is not found but expected to be.

<descriptor> should have class "<className>"

<descriptor> has class "<className>"

Will verify the specified class names (seperated with a space) are present on the element.

The order of the class names does not matter and the element is allowed to have more classes than the ones specified.

 

<descriptor> should not have class "<className>"

<descriptor> does not have class "<className>"

Will verify that the element does not have all classes specified.

If multiple classes are specified (separated with a space), then this step will only fail if the element has all of those classes.

Checkbox, radio button and select

...