ZenoTest — Windows Desktop UI Test Automation
ZenoTest is a lightweight and powerful tool for Windows desktop UI test automation. Record, generate, and run automated tests efficiently for WPF, WinForms, and native apps.

GetQtProperty

string GetQtProperty(string control, string property)

Description
Retrieves a Qt widget property by locating the corresponding UIAutomation element in the application, determining its screen coordinates and class type, and forwarding a GET request to the QtAgent.
If any lookup or communication step fails, the script is aborted and an error is logged.

Typical use cases
Reading the value of visual Qt widgets (e.g., text fields, checkboxes, labels).
Fetching state information not directly exposed by UIAutomation.
Accessing Qt-specific properties required for validations.

Notes
The function relies on UIAutomation to find the control by name.
A center point of the widget's bounding rectangle is used as coordinate reference for the QtAgent.
On any error (lookup failure, missing rectangle, communication issue, agent error), the method logs the failure and aborts the script.

Parameters
control - Name/identifier of the UI element to search for.
property - Property name to retrieve from the Qt widget.

Returns
string - The retrieved property value (payload from the QtAgent).
On failure the script is aborted and the return value is undefined.

Example
void main()
{
    string text = GetQtProperty("TXT_USERNAME", "value");
    Print("Username field contains: " + text);
}
#include CloseAUT Console mode DoubleClick Execute Fail File GetAUTFileVersion GetAUTProductVersion GetAUTQtVersion GetAUTSuspectedCompiler GetAUTSuspectedFramework GetCurrentWorkingDir GetName GetQtProperty GetText GetValue HasFocus IsAUT64Bit IsChecked IsEnabled IsVisible LeftMouseClick LeftMouseDown LeftMouseUp MiddleMouseDown MiddleMouseUp MouseWheel Pass Print RightMouseClick RightMouseDown RightMouseUp Script Language SendKeys SetFocus SetQtProperty Sleep StartAUT string TimerStart TimerStop TimerVerifyLess vec2d VerifyContains VerifyEndsWith VerifyEqual VerifyExists VerifyGreater VerifyLess VerifyNotEqual VerifyNotExists VerifyScreenCompareEdgeBased VerifyScreenComparePixelExact VerifyStartsWith