List view (ListView) controls are used to display a collection of items, each having a text label and, optionally, an icon and a check box. List view can display items in several modes - with full-sized icons or small icons, with additional information displayed in columns on the right of the item, and so on. A user can navigate in the list view by clicking or hot-tracking items, select multiple items, check and uncheck the items and rearrange them.
TestComplete allows you to record and play back various kinds of user actions over list view controls and work with their data from scripts. It provides special program objects that let you operate with various types of list view controls:
Win32ListView
- Provides access to Win32 list view controls.WPFListView
- Provides a scripting interface to WPF (XAML) list views.
TestComplete associates list view controls in the tested application with one of the mentioned scripting objects by analyzing the application type and the controls’ class names. Supported list view classes are listed in the project’s Object Mapping options. You can extend this list, for example, add the class name of a custom list view control used in your tested application, and thus enable the recording and scripting support for this control. For more information, see Default Project Properties - Object Mapping Options.
The topics in this section provide detailed information about working with list view controls in TestComplete and contain script samples that illustrate the explanation. Note that the explanation applies to Win32 list view controls, but most information is valid for WPF list views as well, since the TestComplete support for these controls is similar. Also, TestComplete supports Android list view and expandable list controls. To learn how to work with them, see the Working With Android List View Controls and Working With Android Expandable List Controls sections.
Note: | Though the following topics deal with scripts, you can use the same approaches while testing an application from your keyword tests. For more information, see Keyword Tests Basic Operations. |
In This Section
Working With List View Controls - Basic Concepts
Addressing List View Items and Subitems
Getting the Selected List View Item(s)
Checking and Unchecking List View Items
Checking List View Items' State
Changing List View Items' Captions
Getting List View Items' Images
Working With Owner-Drawn List View Controls
Working With Third-Party List View Controls
Retrieving ListView Items. Example
Related Topics of Interest
Working With List Box Controls
Working With Tree View Controls
See Also
Win32 ListView Support
WPF ListView Support
Object-Specific Tasks
Supported Controls
Default Project Properties - Object Mapping Options