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

SetQtProperty

void SetQtProperty(string control, string property, string value)
void SetQtProperty(string control, string property, int value)
void SetQtProperty(string control, string property, bool value)

Description
Sets a Qt widget property by locating the corresponding UIAutomation element in the application, determining its screen coordinates and class type.
Supported value types are string, integer, and boolean. If any lookup, type conversion, or communication step fails, the script is aborted and an error is logged.

Typical use cases
Updating visual Qt widget values (e.g., filling text fields, checking/unchecking checkboxes).
Modifying state or properties not directly exposed by UIAutomation.
Performing automated input or configuration changes in Qt-based applications.

Parameters
control - Name/identifier of the UI element to modify.
property - Property name to set on the Qt widget.
value - Value to assign to the property. Can be string, int, or bool.

Returns
boolean - true if the property was successfully set. On failure, the script is aborted and the return value is undefined.

Example
void main()
{
    // Set string value
    SetQtProperty("TXT_USERNAME", "value", "JohnDoe");

    // Set integer value
    SetQtProperty("SPN_AGE", "value", 42);

    // Set boolean value
    SetQtProperty("CHK_REMEMBER_ME", "checked", true);
}
#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