Working With Owner-Drawn Combo Boxes in Desktop Windows Applications

Applies to TestComplete 15.70, last modified on December 17, 2024

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

When working with combo box items, TestComplete needs a way to specify them. Usually, TestComplete uses items’ captions or indexes to address them. Using captions is more reliable, since indexes may change during test runs.

Standard Windows controls can be drawn not only by the operating system, but also by an application itself. Controls that are drawn by applications are called owner-drawn. They can have specific content with a custom appearance. Usually, owner-drawn controls store a control’s text separately from the control, so the items’ captions cannot be retrieved, so, TestComplete uses indexes to specify items in owner-drawn combo. So, when testing owner-drawn combo boxes, you need to specify combo box items using their indexes:

ComboBoxObj.ClickItem(3)

To specify items by text, try using the appropriate approaches described in the Object Identification section. For other tips on dealing with non-standard controls, see Ways to Interact With Application Objects.

See Also

Working With Combo Box Controls in Desktop Windows Applications
Win32 ComboBox Support
Testing Owner-Drawn Controls
Working With Combo Box Controls in Web Applications

Highlight search results