Use Module
Calls another test and executes all commands as part of this test.
Parameters
module
The (absolute or relative) path of the module.
When using relative paths, they are always relative to the callers file location.
When using relative paths, they are always relative to the callers file location.
parameters
The parameters (comma separated) to be used when executing the given
module. They can be accessed by their index within the module, e.g. the first parameter as ${1}.
If a parameter contains a comma, precede it with a backslash.
If a parameter contains a comma, precede it with a backslash.
Examples
Use a module that performs the login.
The caller
Call a module that performs the login. The first login is done with user/secret, the second login with admin/master and the last one uses some variables defined in config.properties.
Command | Parameter | Optional Parameter | |
---|---|---|---|
use-module | modules/login.wet | user, secret | |
... | |||
use-module | modules/login.wet | admin, master | |
... | |||
use-module | modules/login.wet | ${usr}, ${pwd} |
The called module
Command | Parameter | Optional Parameter | |
---|---|---|---|
open-url | myapp.html | ||
assert-title | MyApp / Login | ||
set | User Id | ${1} | |
set | Password | ${2} | |
click-on | Login | ||
assert-title | MyApp / Home | ||
assert-content | Welcome ${1} |
The config file
Config (wetator.properties)
...
$usr=tester
$$pwd=accurate
$usr=tester
$$pwd=accurate