Variables of the Object Type

Applies to TestComplete 15.63, last modified on April 10, 2024

Projects, project suites and keyword tests can have variables of the Object type. These variables store object references and provide the ability to operate with objects in event handling routines. For instance, you can apply them to unload a library in the OnStopTest event.

Object type variables have global visibility scope and can be used to obtain an object from any keyword test or script unit or to exchange data between tests or units. These variables are available even when a test run is terminated and script variables do not exist.

The behavior of variables of this type differ from the behavior of variables of ordinary types:

  • The variables can only be assigned from keyword tests or scripts. You can create a new object type variable using the Add Variable wizard or Variables page of the Project, ProjectSuite or Keyword Test editor, but you cannot set the variable‚Äôs value from them.

  • The initial values for object type variables are always empty (null in JavaScript, JScript, C#Script and C++Script, None in Python, Nothing in VBScript and nil in DelphiScript).

  • The values of these variables are not stored between test runs.

See Also

Variable Data Types
Using Variables
Project And Project Suite Variables
Working With Project and Project Suite Variables in Scripts
Keyword Test Variables

Highlight search results