Access to Properties

Applies to TestComplete 15.64, last modified on June 12, 2024

Open Applications provide access to methods, properties and fields of an application’s internal objects. The retrieved information is used by various TestComplete subsystems. For instance, the Object Browser displays property values in the Properties tabbed pages; Name Mapping uses property values to map object names, the Stores project item saves the collection of property values in files.

Some properties of Open Applications’ objects are not available in TestComplete. The reasons for properties becoming unavailable are specific to the application under test and the development tool that it was created in. For more information, see Object Properties, Fields and Methods That Are Unavailable to TestComplete. Unavailable properties are not displayed in the Object Browser and they cannot be used in any way in TestComplete (for instance, they cannot be used for name mapping).

Besides these properties, TestComplete also hides protected and private properties of objects that reside in Open Applications by default. Such functionality is caused by the following reason: applications use special methods to get or set property values. In general, these methods can implement any behavior and perform operations that may cause errors. Since TestComplete calls the get method to obtain property values and display them in the Object Browser; this can cause errors in the application under test. Of course, the damage depends on the tested application, but sometimes the get method may cause critical errors or application freezing. Protected and private properties are especially unsafe in this regard.

To make testing more stable, TestComplete hides the protected and private properties: by default, they are not displayed in the Object Browser and are not used by project items like Name Mapping and Stores. Nevertheless, you can get and set these properties in your scripts.

To make the protected and private properties available to TestComplete, enable the Show hidden members option of the Engines - General Options dialog:

  • Select Tools | Options from the TestComplete main menu and then choose Engines | General from the tree displayed on the left side of the ensuing Options dialog. This will bring up the Engines - General Options page.

  • Enable the Show hidden members option and press OK to save changes.

Note: The described approach is only used for properties and does not concern fields and methods.

To increase testing safety, TestComplete also does not read values of certain .NET objects. When you explore properties of such objects in the Object Browser, the latter displays the string “Cannot get the value of this property.” instead of the property value. This string warns you that reading the property value can be unsafe. It does not forbid you to get or set the property value in scripts. For more information, see Accessing Native Properties and Methods of .NET Objects.

See Also

Object Properties, Fields and Methods That Are Unavailable to TestComplete
Exploring Applications
About Open Applications

Highlight search results