How TestComplete Records and Simulates Actions on .NET Controls
TestComplete identifies individual GUI objects in .NET applications and lets you interact with them from your tests. To learn the types of .NET GUI objects, TestComplete uses their .NET class name (the ClrFullClassName
property). It tells TestComplete whether the object is a button, a check box, a combo box and so on. Based on the object type, TestComplete provides a set of object-specific methods and properties for automating various interactions with the object. For example:
-
Item selection in combo box, list box and list view controls is recorded and played back using the
ClickItem
operation, -
Clicks on grid cells -- using the
ClickCell
operation, -
Calendar date selection -- using the
wDate
property, -
And so on.
When you record user actions over supported .NET 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.
Some controls, such as Label or PictureBox, 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 .NET Controls
For a complete list of supported standard and third-party .NET controls and properties and methods that TestComplete provides for automating these controls, see the following topics:
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 .NET 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 .NET tabular controls.
Using Native Properties and Methods of .NET Controls
In addition to specialized methods and properties for automating operations on .NET GUI objects, TestComplete provides access to native methods and properties of these objects. These are the same methods and properties that are used in the application’s source code. You can use these native methods and properties to perform custom manipulations on your tested .NET controls that are not available with standard TestComplete operations. For more information, see Accessing Native Properties and Methods of .NET Objects.
Automating Unsupported .NET Controls
Interactions with unsupported .NET controls are typically recorded as generic coordinate clicks. Nevertheless, you can automate these controls by calling their native methods and properties from your test or using various helper techniques described in the Interacting With Non-Compatible Application Objects topic.
Users with knowledge of .NET programming can also use TestComplete SDK to create TestComplete plugins for high-level recording and playing back operations on custom .NET controls.
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 the approaches you can use to test your applications’ controls, see the Working with Application Objects and Controls section.
In addition to control-specific operations, there are some common tasks you may need to perform when working with application objects (for example, checking an object's 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 .NET Applications
About Testing .NET Applications
Supported .NET Technologies
Requirements for Testing .NET Applications