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

SetGlobal

void SetGlobal(int option, int value)

Description
Configures a global script setting identified by option.
This function replaces the former SetNotFoundBehavior and provides a unified way to control global behavior flags.

Parameter
- option - The global setting to change. Use one of the predefined constants:
    GLOBAL_NOT_FOUND_BEHAVIOR - Controls what happens when a UI control cannot be found.
    GLOBAL_SCREENSHOT_ON_NOT_FOUND - Controls whether a screenshot is taken when a UI control cannot be found.
- value - The value to assign to the setting:
    For GLOBAL_NOT_FOUND_BEHAVIOR: Use NOTFOUND_ABORT (default) or NOTFOUND_WARN.
    For GLOBAL_SCREENSHOT_ON_NOT_FOUND: Use 1 to enable, 0 to disable (default).

Return
- void

Example
void main()
{
    // Switch to warning mode - missing controls no longer abort the test
    SetGlobal(GLOBAL_NOT_FOUND_BEHAVIOR, NOTFOUND_WARN);

    // Enable screenshot when a control is not found
    SetGlobal(GLOBAL_SCREENSHOT_ON_NOT_FOUND, 1);

    LeftMouseClick("myOptionalButton"); // logs warning + screenshot if not found

    // Restore defaults
    SetGlobal(GLOBAL_NOT_FOUND_BEHAVIOR, NOTFOUND_ABORT);
    SetGlobal(GLOBAL_SCREENSHOT_ON_NOT_FOUND, 0);
}
#define #include abs Array ceil CloseAUT Console mode do...while DoubleClick DragAndDrop Execute Fail File floor for Format GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetClipboard GetCurrentDate GetCurrentTime GetCurrentWorkingDir GetEnv GetName GetProcessID GetProcessIDHandle GetQtProperty GetText GetTimestamp GetValue Handle HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp max MiddleMouseClick MiddleMouseDown MiddleMouseUp min MouseMove MouseWheel Pass pow Predefined Constants Print rand Regex RegexMatch RightMouseClick RightMouseDown RightMouseUp round Script Language SendKeys SendMessage SetClipboard SetFocus SetGlobal SetQtProperty ShellProcess Sleep sqrt srand StartAUT string TerminateProcess TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEmpty VerifyEndsWith VerifyEqual VerifyExists VerifyFalse VerifyGreater VerifyGreaterEqual VerifyLess VerifyLessEqual VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith VerifyTrue WaitForControl WaitUntilEnabled WaitUntilVisible while