Variables

This section describes how you can work with variable in a test sequence

Internal funTEST's variables can be used in the "Parameters" column (arguments of a command). All variables are replaced before executing a row. All variables names are case-sensitive.

Usage

The variable name is always between dollar signs: $variable$ Variables can be use anywhere in the text as many times as necessary.

Example

#msg | "Hello $user-name$! Your login is $user-login$."

Display a simple message with currently logged operator name and login.

List of Standard Variables

User-Defined Variables

Before the row is executed, all test-file variables from the HEAD sheet are collected and added to the list of variables (replacing previous values). Test-file variable names are always converted to lower-case.

All user-defined variable must be listed in the HEAD sheet

#var (Variable operations)

Operations with defines variables in the test-file:

s - set variable(s) value(s)

st - set variables(s) value(s), forced text a - append value(s) to specified variable(s)

r - read values of specified variables

c - clear values of specified variables

Variables shown on the operator's screen are updated automatically when changed on each test-program step.

Commands Overview

Examples

Set value of "text" variable to "abc", return value will be "abc"

#cnt (Counter operations)

Set counter value, increment or decrement counter by a value or only read current counter value. Multiple counter operations can be done at once - use a semicolon ";" or doublecolon ":" to separate each counter operation. In this case, the result is the value of first operation.

Examples

This will only return value of counter "ok".

Last updated