The command reference
General
get_html
Opens a connection to the given url and reads the content. The content is saved for later use.
parameter: the url
support variables: yes
example:
get_html | http://localhost:8080/forum/index.jz
or using a variable:
get_html | ${base_url}
check_title
parameter: the required title
type: test
example:
check_title | The forum index page
Checks if the title of the page is the same as the given title. The entire test will fail
if this test fails
set_proxy
parameter: proxy host and port
type: command
example:
set_proxy | 1.100.100.14:8080
check_link (missing)
parameter: the text within the a tag
type: test
example:
check_link | login
check_text
parameter: the text that must be found
type: test
example:
check_text | Please click here
click_link
parameter: the text within the a tag that should be clicked
type: command
example:
click_link | Click here to register
You can find more information about this command
hereseturlprefix
parameter: the url prefix that will be used by all other tests as base URL
type: command
example:
set_url_prefix | http://www.mysite.com/
enable_javascript
parameter: either true or false to enable or disable javascript
example:
enable_javascript | true
Forms
select_form
parameter: number of the form (the numbering is zero based)
type: command
example:
select_form | 0
Used to select a form.
set_textfield
parameter: name and value of the field with the following syntax: name = value
type: command
example:
set_textfield | username = amecky
This command will fail if no form was selected before
set_checkbox
parameter: name of the checkbox and the value (true or false)
example:
set_checkbox | mode = true
Selects or unselect a checkbox.
submit_form
parameter: name of the submit button
type: command
example:
submit_form | login
This command will fail if no form was selected before or if no submit button is present in the current form with the given name
Tables
select_table
parameter: id or description of the table
example:
select_table | MyTestTable
check_tablecell
parameter: (x,y) position of cell and the value it should contain
example:
check_tablecell | (1,3) = Hello world
Helpers
print_html
parameter: none
type: command
example:
print_html
Prints the current html content to the console
read_properties
parameter: file name of the properties file
example:
read_properties | testcases/test.properties
This command will read in a properties file. These properties can then be used as variables.
See
UsingProperties for a better description