Working With List View Controls

Applies to TestComplete 12.60, last modified on September 17, 2018

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

Describes general principles of working with list view controls in TestComplete.

Addressing List View Items and Subitems

Explains how to address list view items in scripting methods.

Selecting List View Items

Explains how you can select individual list view items from scripts.

Getting the Selected List View Item(s)

Describes how you can obtain the item that is currently selected in the list view, or the list of selected items.

Checking and Unchecking List View Items

Explains how you can simulate checking and unchecking of list view items from scripts.

Checking List View Items' State

Describes how to determine the current state of list view items.

Changing List View Items' Captions

Explains how to create a script that modifies the list view item’s caption.

Getting List View Items' Images

Describes how you can obtain and work with images assigned to list view items.

Working With List View Groups

Explains how you can obtain list view groups and check their properties.

Working With Owner-Drawn List View Controls

Describes the specifics of working with owner-drawn list view controls.

Working With Third-Party List View Controls

Explains how you can operate with third-party list view controls.

Retrieving ListView Items. Example

Contains a sample script that demonstrates how you can export the list view items’ data to a file.

Related Topics of Interest

Working With List Box Controls

Describes how to perform various operations over list box controls with TestComplete.

Working With Tree View Controls

Explains how you can simulate actions over tree view controls with TestComplete.

Table Checkpoints

Explains how to create checkpoints that verify data displayed in tabular controls.

Simulating User Actions

Explains the most common approaches for simulating user actions over applications’ controls.

See Also

Win32 ListView Support
WPF ListView Support
Object-Specific Tasks
Supported Controls
Default Project Properties - Object Mapping Options

Highlight search results