Text Property (TreeViewItem Objects)

Applies to TestComplete 15.44, last modified on November 10, 2022
This property is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This property can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

Use this property to get the text displayed by the given object.

Declaration

TestObj.Text

Read-Only Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

A string that contains the item text.

Remarks

For WPF TreeView Items: If items use a custom data template, TestComplete may fail to return the item’s text correctly and will return an empty string instead. To get the text, you can access the items by using the control’s native properties.

Example

To view an example that demonstrates how to use the Text property, see Getting Selected Tree View Items in Desktop Windows Applications.

Highlight search results