Working With Object Spy Window

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

The Object Spy window allows you to explore and capture onscreen objects and examine their properties, methods, fields and events. The content of the Object Spy Window depends on the selected onscreen object (see Object Tree Models).

Picking Onscreen Objects

You can select an onscreen object in one of the following ways:

  • Pick the object with the target glyph

    1. Drag the target glyph () to the desired object.

    2. Wait until a red frame appears around the object.

    3. Release the mouse button.

  • Point to the object and fix

    1. Click the button and then move the mouse pointer to the desired object.

    2. When a red frame appears around the object, press the Select object shortcut, SHIFT+CTRL+A. This shortcut can be changed in the Global Shortcuts options.

Note: The elements, which a selection tool highlights, depend on the application type: for Open Applications TestComplete “sees” more than is does with black-box applications. For instance, if you move the selection tool over a web page displayed in Internet Explorer, Firefox, or Chrome TestComplete draws a red frame around the page elements (for instance, the DIV, SPAN, A or IMG tags). This does not happen to pages that are shown in other browsers (for instance, Konqueror), because currently TestComplete can only work with these pages in black-box mode (see Web Testing).

Picking Objects in Mobile Applications

To explore objects in mobile applications, select the objects from the Mobile Screen window:

Note: TestComplete can recognize and highlight objects in a mobile application only if the application is prepared for testing.

Select an object from the Mobile Screen window in one of the following ways:

  • Pick the object with the target glyph

    1. Drag the target glyph () to the desired object in the Mobile Screen window.

    2. Wait until a red frame appears around the object.

    3. Release the mouse button.

  • Point to the object and fix

    1. Click the button and then move the mouse pointer to the desired object in the Mobile Screen window.

    2. When a red frame appears around the object, press the Select object shortcut, SHIFT+CTRL+A. This shortcut can be changed in the Global Shortcuts options.

For information on how to select objects in mobile applications, you can also see the Selecting an Object on the Mobile Screen section.

Exploring Object Properties, Methods, Fields and Events

When you select an onscreen object, the window will display the object’s full name, methods, and properties.

The format of the name depends on:

  • The scripting language of the active project (that is, the project whose items are currently selected in the Project Explorer panel). If there is no active project, the Object Browser panel uses the scripting language specified by the Default language option.

  • (For web objects) Whether the active project is configured to use XPath expressions and CSS selectors to locate objects on web pages. If it is, the list of possible locators is available for objects:

    Available locators
  • (For mobile objects) The mobile support type enabled in the current project. By default, the list of possible locators is available for objects. Otherwise, if the legacy support is enabled, the name is based on internal identification properties.

If there is no active project, the default naming format will be used.

The methods and properties displayed in the Object Spy window are organized into categories as in the Object Browser. For more information, see Object Browser Pages.

When you have locked the properties of the desired onscreen object in the Object Spy window, you can quickly find the location of this object in the tree displayed in the Object Browser panel. To do this, either select Highlight in Object Tree from the context menu of the Object Spy window or click the button in this window.

Actually, the object that you are exploring in the Object Spy window can contain a number of properties, fields, methods and events. Searching for a certain property with a large number of them can be inconvenient. Quick Search simplifies searching for certain items in the Object Spy window. It will filter out the items of the currently opened Object Properties page according to the text that you are typing in the Quick Search edit box. The filter applies both to item names and values:

To remove the filter, erase the text you have typed, or just press the button.

Note: The Object Spy window may not display all methods and properties of the selected object. This depends on the window view mode. There are two available modes: Basic (only basic members are displayed) and Advanced (all object members are displayed). By default, the Basic view mode is set. To change the mode, click the link in the header of the Properties table. For more information, see Basic and Advanced View Modes.

Note also that protected and private properties are hidden by default. To view them, you should enable the Show hidden members option in the Engines - General Options dialog. See Access to Properties.

See Also

About Object Browser
Object Browser Pages
Mobile Screen Window
Testing Android Open Applications (Legacy)
Selecting an Object on the Mobile Screen (Android Testing)
Select an Object on the Mobile Screen (iOS Testing)

Highlight search results