TestComplete Tutorial 6 - Object Identification in TestComplete
Different ways to identify objects in TestComplete -
A. By Search Criteria -
1. Name Mapping:
- With name mapping, TestComplete stores all the objects with which your tests interact in the Name Mapping repository.
- These mappings are stored as object where we can specify search criteria like properties provided by TestComplete or xpath expressions or CSS selectors and TestComplete finds these objects in the application.
- User friendly name(Alias) can be given to address the objects from tests.
Examples:
Aliases.browser.page2.btnSave
Aliases.Windows.navigationbar.btnSearch
2. Object Browser:
- TestComplete have the Object Browser panel where all applications, windows and controls that TestComplete recognizes in our system or attached mobile devices are given in the form of Hierarchy.
- Each object in the hierarchy is identified by its type (for example, Process, Window, Browser, Page, WinForms object, XFObject, etc.) and by its properties (for example, ClassName or Caption).
Example:
Sys.Process("msedge").Window("Base_PowerMessageWindow", "", 1)
Sys.Process("explorer").Window("IME", "Default IME", 5)
Sys.Process("explorer").Window("IME", "Default IME", 5)
- Microsoft Active Accessibility (MSAA) is a technology that lets applications provide information about their user interface to other software, for example, screen readers.
- Information about the application’s UI elements is exposed via the special IAccessible interface.
- This interface provides information about the type of the underlying control, its name, location and current state, and provides methods for manipulating that control.
- This way, active accessibility information can be used for functional (or user interface) testing.
Note: | You can get the latest version of the Active Accessibility from Microsoft Download Center – Platform SDK: Microsoft Active Accessibility 2.0 Redistributable |
- Microsoft .NET Framework v.3.0 and later includes a special UI Automation Framework. One of its purposes is assisting in application testing by providing program access to user interface elements.
- TestComplete supports the UI Automation technology and can use UI Automation to access properties and methods of windows and controls.
- TestComplete includes a special plugin, UI Automation Support, that provides support for the UI Automation technology.
- If the plugin is installed, TestComplete uses the UI Automation providers to obtain information on UI elements of the application under test.
- UI Automation Framework includes special providers that expose properties of buttons, check boxes, menus and menu items, data grids, list boxes and other controls.
Note: The UI Automation Support plugin must be enabled in TestComplete. The plugin is installed and enabled automatically when you install TestComplete.
1. Optical Character Recognition:
- Sometimes there are some properties or controls which TestComplete cannot access or identify.
e.g. - Bitmap or chart
- To test such windows or controls TestComplete uses Optical character recognition (OCR) to translates images of rendered text into computer-readable characters and works with the areas that contain the needed text.
- This helps you have more stable and flexible tests in comparison with tests that use coordinate-based mouse clicks.
- To get the text contents of your tested application or a specific UI element to verify your tested application’s data or state.
- Verify data displayed in a tabular form.
- Find the needed UI element in your tested application by its text contents and simulate user actions on it.
- You can identify custom-drawn objects in Windows desktop applications by their text contents.
If your tested application is a “black-box” application, that it, it provides access neither to its internal properties, nor to its accessibility information and text contents, you can identify individual controls in the application by their images.
Comments
Post a Comment