Working With List Box Controls

Applies to TestComplete 14.40, last modified on April 22, 2021

TestComplete supports most standard Windows controls, including list boxes. It provides the Win32ListBox program object to work with Win32 list boxes. In fact, this object is automatically associated not only with standard Win32 list boxes, but with all list box controls whose class names are specified in the Win32 Controls and Windows | List Box group of the project’s Object Mapping options. If your tested application uses a custom list box control, you can associate it with the Win32ListBox object by adding its class name to the Object Mapping list. For more information, see Default Project Properties - Object Mapping Options.

The Win32ListBox object’s methods and properties let you perform various operations over list box controls. In addition, if the tested application is an Open Application, the internal methods and properties of the list control are also visible to TestComplete and accessible from tests as well. To learn which methods and properties of the list box control are available to your tests, explore the control in the Object Browser.

The topics of this section discuss common operations that can be performed over list box controls.

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

Selecting a Single List Box Item

Explains how to select an item.

Selecting Multiple List Box Items

Describes how to select a set of items.

Getting a Single List Box Item

Describes approaches, which you can use to obtain the needed item.

Getting Several List Box Items

Describes how to obtain a set of items.

Determining the Number of List Box Items

Explains how to count the total number of list box’s items.

Determining Current List Box Item

Describes how to determine currently focused item.

Checking Whether a List Box Item Is Selected

Explains how to determine whether an item is selected.

Determining List Box Item Bounds

Contains information on how to obtain item’s bounds.

Clicking Within a List Box Item

Explains how to perform clicking on the specified point of an item.

Retrieving List Box Items. Example

Contains a sample script that demonstrates how you can process the list box items in a loop.

Related Topics of Interest

Working With Combo Box Controls

Explains how you can simulate actions over combo box controls with TestComplete.

Working With List View Controls

Describes how to perform various operations over list view controls using 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 ListBox Support
Object-Specific Tasks
Supported Controls
Default Project Properties - Object Mapping Options

Highlight search results