Actions

Actions are operations that can be performed to get the browser into the desired state.

Syntax

An action takes the form of a verb followed optionally an argument, a keyword and an additional argument.

The verb is always required. Whether arguments and keywords are optional is dependent on the verb.

{verb} [{arguments-section}]

----------------------------

verb:
    back
    click
    forward
    reload
    set
    submit
    wait
    wait-for

arguments-section:
    dependent on the verb

Click

Click on an element.

click {identifier}

------------------

identifier:
    <identifier>

Arguments

identifier <identifier> An identifier.

Examples

- click $".sign-in-form .submit-button"
- click $".listed-item":1
- click $imported_page_model.elements.element_name
- click $elements.element_name

Set

Set the value of an element. Most applicable to form field elements.

set {identifier} to "{value}"

-----------------------------

identifier:
    <identifier>

value:
    <string>

Arguments

identifier <identifier> An identifier.
value <string> A string.

Examples

- set $"#sign-in-form .username" to "user@example.com"
- set $"#sign-in-form .username" to "\"user@example.com\"" # (literal double quotes)
- set $imported_page_model.elements.username to "user@example.com"
- set $elements.element_name to "user@example.com"
- set $elements.element_name to $data.field_name
- set $".selector" to $page.title # odd but valid
- set $"//foo" to $page.url       # also odd but valid
- set $".input1" to $".input2"    # also odd but valid

Submit

Submits a form.

submit {identifier}

-------------------

identifier:
    <identifier>

Arguments

identifier <identifier> An identifier.

Examples

- submit $"#sign-in-form"
- submit $imported_page_model.elements.submit_button
- submit $elements.element_name

Wait

Wait for a specified number of seconds.

wait {number-of-seconds}

------------------------

number-of-seconds:
    <positive-integer>

Arguments

number-of-seconds <positive-integer> An integer greater than zero.

Examples

- wait 1
- wait 15
- wait $data.duration
- wait $env.DURATION

Wait-for

Wait for an element to be rendered. Waits for up to 30 seconds.

wait-for {identifier}

---------------------

{identifier}:
    <identifier>

Arguments

identifier <identifier> An identifier.

Examples

- wait-for $"#asychronously-loaded-content"
- wait-for $imported_page_model.elements.delayed_element_name
- wait-for $elements.delayed_element_name

Reload

Reload the current page.

reload

Forward

Move forward one item in the current session history.

forward

Back

Move back one item in the current session history.

back

Example List

- click $".sign-in-form .submit-button"
- click $".listed-item":1
- click $imported_page_model.elements.element_name
- click $elements.element_name
- set $"#sign-in-form .username" to "user@example.com"
- set $"#sign-in-form .username" to "\"user@example.com\"" # (literal double quotes)
- set $imported_page_model.elements.username to "user@example.com"
- set $elements.element_name to "user@example.com"
- set $elements.element_name to $data.field_name
- set $".selector" to $page.title # odd but valid
- set $"//foo" to $page.url       # also odd but valid
- set $".input1" to $".input2"    # also odd but valid
- submit $"#sign-in-form"
- submit $imported_page_model.elements.submit_button
- submit $elements.element_name
- wait 1
- wait 15
- wait $data.duration
- wait $env.DURATION
- wait-for $"#asychronously-loaded-content"
- wait-for $imported_page_model.elements.delayed_element_name
- wait-for $elements.delayed_element_name
- reload
- forward
- back