Using Object Spy

If the tested application is a quite complex one and contains many different controls, locating the necessary element in the Object Browser panel may be quite a challenge.

To facilitate the task at hand, we can use the Object Spy utility.

Note

If you are using TestComplete of Version 7 or below, Object Spy will go by the name of Object Properties, and is no different otherwise from Object Spy.

How to do it...

In order to get acquainted with Object Spy we need to perform several steps:

  1. Click on the Display Object Spy button on the toolbar.
    How to do it...
  2. In the result, the TestComplete window will minimize and the screen will have the Object Spy window displayed.
    How to do it...
  3. Now we need to signify the particularly necessary object in the Object Spy window. To this end, we have the following two methods:
    • Drag-and-drop by the mouse the sign of the target onto the necessary object and wait until the control element highlights it in red. Once this has occurred let go of the mouse button.
    • Press the Point and fix icon, hover the mouse cursor over the necessary object and press the following combination of keys: Shift + Ctrl + A.

    In any case, in the list below, we will see a list of available properties similar to the list in Object Browser.

  4. In order to see the selected element in Object Browser, click on the Highlight Object button in the Objects tree in the top-right corner of the Object Spy window.

How it works...

TestComplete highlights the control elements, which it can identify. Do not be surprised if you happen to find out that some of the elements (for example, menu items, toolbar buttons, individual table elements, and so on) are not highlighted, while the whole group of elements is. Such behavior stands for either of the two:

  • This is a compound control element and TestComplete can't highlight its internal component, only a whole compound control can be recognized and highlighted
  • A given control element is not supported by TestComplete altogether

The Object Spy window displays information about controls the same way as Object Browser does. There is a tab control with available properties and methods at the bottom and a full name of the control above it. There is also a Search field, which allows us to quickly apply a filter to the list of properties and methods to find the necessary item in the list.

See also

  • The Working with nonstandard controls recipe in Chapter 3, Scripting, will guide you on working with nonstandard controls which are not recognized by TestComplete
  • If you want to know how to find specific control by coded script, you can move to the Finding objects by properties' values recipe in Chapter 5, Accessing Windows, Controls, and Properties
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.196.172