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

Format

string Format(string fmt, ...)

Description
Returns a formatted string, similar to sprintf.
The format string may contain any number of format specifiers which are replaced by the corresponding arguments.

Supported specifiers
| Specifier | Type | Description |
|-----------|------|-------------|
| %d, %i | int | Signed decimal integer |
| %u | int | Unsigned decimal integer |
| %f | float | Decimal floating point |
| %g | float | Shortest representation (fixed or scientific) |
| %e | float | Scientific notation |
| %s | string | String — any type is automatically converted |
| %% | — | Literal percent sign |

Width and precision modifiers are supported (e.g. %05d, %.2f, %-10s).

Parameter
- fmt - The format string.
- ... - Zero or more values to substitute into the format string.

Returns
The formatted string.

Example
void main()
{
    string s1 = Format("Value: %d", 42);              // "Value: 42"
    string s2 = Format("Pi: %.2f", 3.14159);          // "Pi: 3.14"
    string s3 = Format("%s has %d items", "List", 5); // "List has 5 items"
    string s4 = Format("Progress: %05d%%", 7);        // "Progress: 00007%"
}
#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 SetNotFoundBehavior 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