TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


Tokens are similar to macros. They are replaced at runtime with the predefined values. There are system tokens like “curStateID”, “curTransID”, etc.

You can also define your own tokens. This is done through the token.properties file in “config/” folder.

The custom tokens are defined with a “code”=“value” pair, typically one line per token.

Custom tokens must be referenced with a prefix “@” symbol.

For example the following line defines a “msg_FieldMissing” to a static string:

   msg_FieldMissing=Missing field detected.

You then use this in mScript:

  <if value1="$isVisible('myField')" op="ne" value2="true">
   <log msg="Error: [@msg_FieldMissing] - myField "/>

Usually each token is defined in the token.properties file in one line. However, if you want to span the token definition over multiple lines for better readability, you can do so by ending each intermediate lines with back-slash char “\”.

For example:

  myToken=line1 \
          line2 \
          last line

Regardless of multiple lines, they are concatenate together into a single one line text when the token is used with white spaces removed.

Rel 3.0.13

custom_tokens_configuration.txt · Last modified: 2016/09/22 02:35 (external edit)