Working With List Box Controls in Desktop Windows Applications

Applies to TestComplete 15.46, last modified on December 01, 2022

Note: To learn how to simulate user actions over list box controls in web applications, see Working With List Box Controls in Web Applications.

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

Getting a Single List Box Item in Desktop Windows Applications

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

Getting Several List Box Items in Desktop Windows Applications

Describes how to obtain a set of items.

Determining the Number of List Box Items in Desktop Windows Applications

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

Determining Current List Box Item in Desktop Windows Applications

Describes how to determine currently focused item.

Checking Whether a List Box Item Is Selected in Desktop Windows Applications

Explains how to determine whether an item is selected.

Determining List Box Item Bounds in Desktop Windows Applications

Contains information on how to obtain item’s bounds.

Clicking Within a List Box Item in Desktop Windows Applications

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

Retrieving List Box Items in Desktop Windows Applications. 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 in Desktop Windows Applications

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

Working With List View Controls in Desktop Windows Applications

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
Working With List Box Controls in Web Applications
Supported Controls
Default Project Properties - Object Mapping Options

Highlight search results