Accessing Native Properties and Methods of WPF Objects

Applies to TestComplete 14.81, last modified on May 04, 2021

TestComplete identifies individual GUI objects in WPF applications and provides specialized methods and properties for automating various operations on these objects, getting object data, checking state, and so on. However, if these predefined properties and methods are insufficient for your testing needs, you can use native properties and methods of WPF objects to complete desired tasks. These are the same properties and methods that are available for use in the tested application’s source code as well as custom properties and methods implemented by the application developers. This way, you can perform almost any operations in the tested WPF application, even those that are not accessible via the application’s GUI.

The Object Browser marks objects of WPF applications with the glyph. To view native properties and methods available for a WPF object, use the Object Spy or Object Browser in the Advanced view mode. Native properties and methods of WPF objects are displayed under the .NET and WPF Attached Properties categories.

TestComplete gives you access to native properties and methods of any access type, including public, protected and private.
TestComplete shows attached properties only with non-default values. If a WPF object does not contain attached properties with non-default values, the WPF Attached Category for this object will be hidden in the Object Browser and Object Spy.

Native Properties of a WPF ListView Object in Object Browser

Click the image to enlarge it.

For detailed information on how to get and set native WPF object properties and call native methods from your tests, see the following topic:

Accessing Native Properties and Methods of .NET Objects

Note that besides properties and methods of WPF GUI objects, TestComplete lets you access properties and methods of any .NET class defined in the application and its referenced assemblies. To learn how to do that, see Calling Functions From .NET Assemblies.

See Also

Testing WPF Applications
About Testing WPF Applications
Accessing Native Properties and Methods of .NET Objects

Highlight search results