A command is a word or a series of words used in a Test Case (TC) to request an action.
You can assign the result of a command to a variable. Read more about variables at the bottom of the page.
Command |
Description |
Syntax |
Parameters |
Examples |
|---|---|---|---|---|
exec |
Executes the given command. |
exec <command> |
The command to execute. Can be single line with " and multi-line with """. Multi-line is used, when command to execute contains other quotes. |
exec "fw.list" |
assertEquals |
Asserts that the expected message is available in the current output and clears - the output. Note: that it matches the full output. |
assertEquals [timeout] <assert_message> <expected_message> |
Time interval in seconds.
If expected message and actual message are different, a message is thrown with the given message.
Expected value. Can be single-line with " and multi-line with """. |
Example 1 Example 2 Example 3 |
assertIndexOf |
Asserts that the expected message can be found in the current output and clears this message. Note: that it matches only a part of the output. |
assertIndexOf [timeout] <assert_message> <part_of_expected message> |
Time interval in seconds.
If actual message does not contain the expected message, a message is thrown with the given message.
Part of the expected output. |
Example 1 Example 2 Example 3 Module Type UID Label |
assertRegEx |
Asserts that the regex matches a string from the current output and clears the matching. Note: that it matches only a part of the output. |
assertRegEx [timeout] <assert_message> <regex> |
Time interval in seconds.
If actual message does not contain the expected message, a message is thrown with the given message.
The regular expression to which expected output to be matched.
|
Example 1 Automation Event Subscription : %subID% Example 2 assertRegEx "fw.install file command" "(.)*demo.test.permissions.bundle.jar was installed. Bundle ID is (\d+)" |
if ... endif |
Conditional execution of test commands/scripts. |
if condition command1 ... commandN endif |
The boolean expression after the if command is called the condition. If it is true, then the immediately following indented commands get executed. If the condition is false, the indented commands are skipped. There is only one logical operator who can be used- or (||). This condition should be predefined variables about security mode and all execution environments. |
Example 1 Example 2 |
set |
Extracts the values of all regex groups in the variable. The matching is done on the current output. |
set <regex> <var1 var2 ... varN> |
The regular expression, who match the entire or part of actual output. <var1 var2 ... varN> - mandatory Variables which you want to set via groups in regular expression. |
exec "atm.sub Rule -a" |
clear |
Clear of the current output |
clear |
– |
exec "kitman.i Automation" |
sleep |
Pause the execution and wait for some time. |
sleep <timeout> |
The number of seconds to wait. |
exec "fw.rs %bundleID%" |
// |
A comment is text that is ignored by TC when a script is executed. You can use comments to describe what is happening in the script or make other kinds of notes. |
// <text> |
|
Example 1 Example 2 |
Variables
You can use variables in TC to store and manipulate values.
Predefined variables
There are a three types predefined variables, available for all scripts:
User defined variable
For example, the following statements create and initialize two variables, one named demoID and one named hostID:
exec "fw.install %res.dir%/demo.test.permissions.bundle.jar"
set ".*Bundle ID is (\d+)" demoID
exec "fw.install %res.dir%/host.jar"
set ".*Bundle ID is (\d+)" hostID
Scope refers to the visibility of variables. Variables exists only within the script that it is declared in.
For example, variable declared in install.txt TS is visible only in install.txt
Using variables
Variables are not available outside the file in which they are declared.
To use an already declared variable, should be used % in the beginning and end of the variable name.
exec "fw.bundle %demoID%"
Scope of variables
Scope refers to the visibility of variables. Variables exists only within the script that it is declared in.
For example, variable declared in install.txt TS is visible only in install.txt.