ZenoTest
ZenoTest — Windows desktop UI test automation for Qt, WPF, WinForms & native apps. Record, script, and run automated GUI tests with CI/CD integration.

#define

Description
The #define directive defines a named constant or text substitution (macro) that is replaced throughout the script before execution.
It works similarly to the C preprocessor: every occurrence of the defined name in the code is replaced with the specified value before parsing.
#define directives are processed at the very beginning, before any other interpretation takes place.

Syntax
#define NAME value

Rules
- NAME must be a valid identifier (letters, digits, underscores; must not start with a digit).
- value is optional. If omitted, the name is replaced with an empty string.
- Replacements are word-boundary aware: only whole identifiers are replaced, not partial matches inside other identifiers.
- Replacements do not occur inside string literals or comments.
- A #define line is not visible to the parser and does not affect line numbering.

Example
#define MAX_RETRIES 5
#define LOGIN_BTN "BTN_LOGIN"
#define TIMEOUT 30000

void main()
{
         StartAUT(TIMEOUT);

    int retries = 0;
    while (retries < MAX_RETRIES)
    {
        LeftMouseClick(LOGIN_BTN);
        retries++;
    }
}
#define #include CloseAUT Console mode do...while DoubleClick Execute Fail File for GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetCurrentWorkingDir GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp MiddleMouseDown MiddleMouseUp MouseWheel Pass Predefined Constants Print rand RightMouseClick RightMouseDown RightMouseUp Script Language SendKeys SendMessage SetFocus SetNotFoundBehavior SetQtProperty ShellProcess Sleep StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEndsWith VerifyEqual VerifyExists VerifyGreater VerifyLess VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith while