Applies to TestComplete 14.60, last modified on September 18, 2020
Most applications have the menu system that provide a list of commands a user can perform. Each window typically has several types of menus associated with it: a top-level window may have the system menu, the main menu and the context menu, and a control may have a context menu as well:
- Main menu is usually displayed under the window’s title bar and provides access to the list of all commands available to the user that are grouped by categories.
- System menu is invoked upon clicking the window’s icon on the left of the title bar. It contains commands for managing the window -- moving, resizing and closing it. System menus can also hold custom commands, for example, for navigating between application’s windows.
- Context menu is shown for the selected object or control by right-clicking it, and holds items specific to the current context. Context menus are also called popup menus or shortcut menus.
TestComplete can record and play back user actions over menus. It provides the
Menu program object which lets you work with various kinds of menus. The topics of this section provide detailed information about working with menu controls in TestComplete and contain script samples that illustrate the explanation.
||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
Describes general principles of working with menu controls in TestComplete.
Describes how you can display a context menu for windows and controls.
Explains how you can access and address individual menu items.
Explains how to select menu items from tests.
Describes how you can determine if a menu item is enabled or disabled.
Describes the specifics of working with owner-drawn and bitmap menus.
Explains how you can work with menus created using third-party menu components.
The following topics contain sample scripts that perform common operations over menus:
Demonstrates how to select an item in the application’s main menu.
Demonstrates how you can check items in the application’s main menu.
Demonstrates how you can paste the control’s text from clipboard using the context menu.
Related Topics of Interest
Explains how you can work with toolbar controls in TestComplete.
Provides a brief overview of scripting objects and routines used to simulate actions over menus.
Simulating User Actions