Skip to content

User Operation

Jye Ruey edited this page Apr 19, 2021 · 3 revisions

User operation

This page provides the usage information for the user operation which can be used in the YAML test code's key. "exec" .

User operation List

go

Access the url.

exec:
  operate: go
  url: https://github.com/

back

Go back the last page.

exec:
  operate: back

refresh

Refresh the page.

exec:
  operate: refresh

input

Input the text.

Use page and part to specific the input element.

exec:
  operate: input
  page: page_name
  part: part_name
  word: Write something

clear

Clear the text.

Use page and part to specific the input element.

exec:
  operate: clear
  page: page_name
  part: part_name

click

Click the element.

Use page and part to specific the element.

Note: The element should be clickable, or it will get an error.

exec:
  operate: click
  page: page_name
  part: part_name

Note: Use num and locate to choose in multiple elements.

exec:
  operate: click
  page: page_name
  part: 
    num: 0 # The number start from 0
    locate: part_name

choose

Choose the option in select element.

Use page and part to specific the select element.

Note: The option can be chosen by three ways: index, value or text.

By index:

Note: Index is start by 0.

exec:
  operate: choose
  page: page_name
  part: part_name
  index: 0

By value:

exec:
  operate: choose
  page: page_name
  part: part_name
  value: value in tag

By text:

exec:
  operate: choose
  page: page_name
  part: part_name
  text: option text

accept_alert

Accept the alert in page.

exec:
  operate: accept_alert

switch_to_next_window

Switch to the next tab in browser.

exec:
  operate: switch_to_next_window

switch_to_previous_window

Switch to the previous tab in browser.

exec:
  operate: switch_to_previous_window

switch_to_newest_window

Switch to the newest tab in browser.

exec:
  operate: switch_to_newest_window

switch_to_oldest_window

Switch to the oldest tab in browser.

exec:
  operate: switch_to_oldest_window

switch_to_the_window

Switch to specific tab by name.

exec:
  operate: switch_to_the_window
  window_name: tab name

close

Close the current tab in browser.

exec:
  operate: close

wait

Add some wait times in the test.

Note: Wait times can only be set in second.

exec:
  operate: wait
  sec: 5

stop

Add stop point in the test.

Note: Continue triggers by enter key.

exec:
  operate: stop
Clone this wiki locally