Support for Visual C++ Applications' Controls

Applies to TestComplete 15.20, last modified on January 19, 2022

How TestComplete Records and Simulates Actions on Visual C++ Controls

TestComplete provides support for a number of most popular controls of Visual C++ applications. It automatically recognizes individual controls by their classes (the value of control’s ClassName property) and lets you interact with them both at design time and during recording or playback. Based on the object type, TestComplete provides a set of object-specific methods and properties for automating various interactions with the object. For example:

  • Clicking a button is recorded and played back using the ClickButton operation,
  • Item selection in combo box, list box and list view controls -- using the ClickItem operation,

  • Clicks on grid cells -- using the ClickCell operation,

  • And so on.

When you are recording user actions over supported Visual C++ controls, TestComplete records these special methods and properties applied to the corresponding objects, rather than just coordinate clicks. You can see some of these methods, specifically, SetText, ClickItem and ClickButton, in the sample test below.

Sample keyword test recorded for Visual C++ application

Some controls, such as Label, do not have specific high-level operations associated with them, because users do not generally interact with these objects. However, these objects are also available in the application’s object hierarchy, and you can use them in your tests if needed. For example, you can create checkpoints for these objects.

List of Supported Visual C++ Controls

For a complete list of supported Visual C++ controls and properties and methods that TestComplete provides for automating these controls, see the following topics:

Standard Windows Controls

MFC Controls

Rogue Wave Controls

CodeJock Controls

Two notes:

  • TestComplete support for MFC and Rogue Wave controls includes a number of specific scripting methods and properties that simplify testing of individual controls. Note that these specific methods and properties are exposed by Debug Info Agent™. The wrapper classes do not provide the functionality needed for this. So, in order for the test engine to be able to execute these methods and properties, the Visual C++ application under test must be compiled with debug information.
  • TestComplete supports CodeJock Xtreme controls for Visual C++ MFC by using the Microsoft Active Accessibility (MSAA) technology.

Note that TestComplete provides support both for the listed controls and for their descendants. However, to make this possible, you need to specify the class name of your inherited control in the corresponding group of the project’s Object Mapping options.

Support for Tabular Controls

TestComplete allows creating Table Checkpoints for some Visual C++ controls that represent information in a tabular form (for a complete list of these controls see About Tables Collection). With table checkpoints you can retrieve and compare data of Visual C++ tabular controls.

Using Native Properties and Methods of Visual C++ Controls

In addition to control-specific methods and properties for automating operations over Visual C++ controls, TestComplete provides access to native properties, fields and methods of these objects. These are the same properties, fields and methods that are used in the application’s source code. You can use these native properties, fields and methods to extend your tests and perform custom operations that are not available with standard properties and methods provided by TestComplete. For more information, see Accessing Native Properties and Methods of Visual C++ Objects.

Automating Unsupported Visual C++ Controls

You can test unsupported Visual C++ application controls by using the properties and methods provided by TestComplete to onscreen objects. Interactions with these controls are typically recorded as coordinate clicks.

You can also automate these controls by calling their native properties and methods from your test or by using various helper techniques described in the Interacting With Non-Compatible Application Objects topic.

Further Reading

To learn how to perform simple testing operations over application controls, see Working With Standard Windows Controls. This section includes a description of most common control-specific operations you may need to perform over the tested controls (for example, checking a button’s state, determining the number of combo box items, getting tab page images, expanding and collapsing tree view items and so on). For detailed information on approaches you can use to test your application controls, see the Working with Application Objects and Controls section.

In addition to control-specific operations, there are common tasks you may need to perform over any application object (for example, checking the object state, searching for an object or checking whether an object exists). For a complete list of these basic operations and for a description of how to perform them, see Common tasks.

See Also

Testing Visual C++ Applications
Supported Controls

Highlight search results