Basic Data Types

Applies to TestComplete 15.62, last modified on March 14, 2024

TestComplete uses data types that are supported by script engines and that are compatible with the VARIANT data type. This data type is used in certain programming languages like Visual Basic and C++. VARIANT is a universal type that can be used to store almost any kind of data: number, string, date/time, true/false, references to objects, arrays and so on. All variables and parameters that you create and use in your test projects are VARIANT-compatible.

When describing methods and properties of test objects, TestComplete helps use the following data types (which are VARIANT-compatible):

Integer

An integer number, from -2147483648 to 2147483647.

Double or Real

A floating-point value, for instance, 3.14. Real is used in DelphiScript. In other scripting languages, this data type is called Double. Range of available values:
-1.79769313486232×10308  … -4.94065645841247×10-324 for negative values;
 4.94065645841247×10-324 …   1.79769313486232×10308 for positive values.

String

Any textual data (a single character or an arbitrary string). In JavaScript, JScript, VBScript, C#Script and C++Script string data is enclosed in quotes, for instance, "my text". In DelphiScript, string data is enclosed in apostrophes, for instance, 'my text'. In Python, both are acceptable.

Boolean

A value that is either True, or False. In Python, use the title case spelling: True, or False. If you use JavaScript, JScript, C#Script or C++Script, use the lower-case spelling: true, false. VBScript and DelphiScript are not case-sensitive.

Date/Time

A value that stores a date, time or both date and time. This special type is used to perform various operations over date and time values easily. See Working With Dates and Working With Time.

Object

A value that is a reference to some object, for instance, to an object that provides a scripting interface to a window or control, or to an object that provides access to a window image. An example of the Object type usage is the Picture parameter of the Log.Picture method.

In some cases, TestComplete panels and dialogs report a property or parameter has the IDispatch type. IDispatch is an interface that is introduced by the Component Object Model (COM). Your test scripts can work with the COM objects implementing the IDispatch interface.

Variant

Any VARIANT-compatible value. This type is universal and it means the value can hold any data: strings, numbers, references to objects and so on. For instance, the Variant type is used for parameters of the Runner.CallMethod method, since in general they can be values of any supported type.

The Variant type is also used if a value can have various types, for instance, either boolean or integer like the State parameter of the Check action.

See Also

Script Tests

Highlight search results