Script Language
DescriptionThe Script Language is a lightweight, C-like scripting language designed for automated testing and system interaction.
It supports typed variables, conditional logic, functions, and integration with predefined automation methods (e.g., Pass, Fail, Execute).
Scripts are executed line by line, with clear syntax and structured blocks using curly braces.
Key Features
- Strongly typed variables (bool, int, float, string, etc.)
- Conditional logic with if / else statements
- Multi-branch selection using switch / case / default / break
- Function definitions with return values
- Built-in methods for test verification and result reporting
- Automatic type checking and expression evaluation
- Simple syntax similar to C / C++ for easy readability
Supported Data Types
- void - No return value (used for main or utility functions)
- bool - Boolean values (true / false)
- byte - 8-bit unsigned integer (0-255)
- int8 - 8-bit signed integer (-128-127)
- int - Standard integer type
- float - Floating-point number
- string - Unicode text
Control Flow
- if and else statements allow conditional branching based on logical expressions.
- switch statements allow multi-way branching based on the value of an expression.
Each case represents a possible value to match, and break ends the execution of a case.
default is executed if no case matches.
- Curly braces are required to define code blocks.
Operators
- Arithmetic: +, -, *, /
- Comparison: ==, !=, <, <=, >, >=
- Logical: !, &&, ||
Special Keywords
- return - Return a value from a function.
- true, false - Boolean constants.
- switch, case, default, break - Multi-branch control flow.
Functions
Functions are declared using a return type, a name, and parentheses with optional parameters.
Each script must contain a main() function as its entry point.
Example
void main()
{
string name = "World";
if (name == "World")
{
Pass("Hello " + name);
}
else
{
Fail("Unexpected value");
}
int value = 2;
switch(value)
{
case 1:
Pass("Value is 1");
break;
case 2:
Pass("Value is 2");
break;
default:
Fail("Value is unknown");
}
}
Typical Use Cases
- Automated GUI testing
- Verifying functional behavior of desktop applications
- Running command-line based system tests
- Creating reusable test logic via user-defined functions
Notes
- Script execution always begins in void main().
- Most automation-related methods (e.g., mouse or keyboard functions) require an active AUT (Application Under Test).
- Scripts stop immediately after calling Fail() or Pass().
- The language is case-sensitive.