SetNotFoundBehavior
void SetNotFoundBehavior(int mode)Description
Configures the behavior of all subsequent script methods when a UI control cannot be found.
By default (NOTFOUND_ABORT), the test execution is stopped immediately when an element is not found.
Setting the mode to NOTFOUND_WARN causes the method to log a warning instead and continue the test execution.
Parameter
- mode - The behavior mode. Use one of the predefined constants:
NOTFOUND_ABORT - Abort the test if an element is not found (default).
NOTFOUND_WARN - Log a warning and continue execution if an element is not found.
Return
- void
Example
void main()
{
// Switch to warning mode - missing controls no longer abort the test
SetNotFoundBehavior(NOTFOUND_WARN);
LeftMouseClick("myOptionalButton"); // logs warning if not found, continues
// Restore default abort behavior
SetNotFoundBehavior(NOTFOUND_ABORT);
LeftMouseClick("myRequiredButton"); // aborts if not found
}