Formatting Watch Expressions

Applies to TestComplete 15.47, last modified on January 20, 2023

The Watch List panel uses a default display format that adapts to the type of value it displays. For instance, it displays a decimal for integers. You may wish to override these defaults.

To format a watch expression, right-click it in the Watch List and then choose Edit from the context menu. The Watch Properties dialog will appear.

In the dialog, you can either use one of the radio buttons (Default, Hexadecimal or Floating point) or directly enter a format specifier after a comma, in the Expression edit box. Below is information on available formats and specifiers.

Formats

Format Types Affected Description
Hexadecimal Integers or characters Displays integer values in hexadecimal form (with the 0x prefix in JavaScript, JScript, Python, C#Script and C++Script, &H in VBScript, and $ in DelphiScript).
Floating point Floating point Displays significant decimal digits as specified in the Digits field, from 2 to 18.
Default All Displays the result in a format that matches the data type of the expression.

Specifiers

Specifier Types affected Description
,h Integers Hexadecimal. Displays integer values in the hexadecimal form (with the 0x prefix in JavaScript, JScript, Python, C#Script and C++Script, &H in VBScript, and $ in DelphiScript).
,fn Floating point Floating point. Displays n significant digits where n can be from 2 to 18. For instance, to display the first four digits of a floating-point value, type ,f4. If n is not specified, the default is 11.

The specifiers should follow the value to be evaluated, for instance, Var1,h will display the value of the Var1 script variable in hexadecimal format. If Var1 is a keyword test variable, use the KeywordTests.KeywordTest_Name.Variables.Var1,h syntax.

See Also

About Watch List Panel
Watch Properties Dialog

Highlight search results