Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Oct 05, 2020 11:51

Perfecto’s Object Spy supports the creation process of your test automation by providing information about object locators/identifiers. It is seamlessly operated, with no need for any external tool support.

Object Spy provides a quick snapshot of your native app, hybrid app, or website. It lets you explore objects on the device screen and view them in the Object tree pane. 

The object tree presents a hierarchical view of all objects retrieved from the webpage or app. You can either select an object on the device screen or in the tree hierarchy to view related information in the adjacent Properties pane, which displays a wide range of object parameters. In particular, it lists the following properties:

  • Smart locator (formerly referred to as object locator)
  • Xpath
  • X and Y coordinates
  • Height and width
  • Resource ID
  • Package
  • Origin class
  • Class

For boolean properties, the pane provides information on whether they are turned on (indicated by a green checkmark ) or off (indicated by the general prohibition sign ). 

You can instantly copy the required path or property to the clipboard to embed it in your automated tests. 

In addition, Object Spy lets you:

  • Filter the tree by the following object types: buttons, edit fields, images, links, texts, and other objects. This is helpful when the tree is long and complex and you want to focus on specific objects.

    Note: When a filter is applied, the object tree reverts to a flat view. A hierarchical view is only available when all objects are displayed. In addition, selecting an object on the device screen does not bring up any object in the tree if the selected element is hidden by the filter.
  • Download the entire object tree as an XML file or HTML file (for web views) for offline use.

To spy for objects on another screen of your app or web page, you need to close Object Spy, navigate to the new screen, and then open Object Spy again.

To access and use Object Spy:

  1. On the device toolbar, click the scouting icon . Object Spy opens in the right pane. You can expand nodes as needed. If required, you can extend the pane to the left by dragging the handles .
  2. (Optional) To simplify the tree, configure the maximum number of children included in the tree, as follows. However, note that the object you select on the screen may not be displayed in the tree if you limit the number of children.
    1. Click the gear icon .
    2. In the Settings form, select the Set max children checkbox.

       Click to view image
    3. Specify the maximum number of children.
    4. Click Save.
    5. Close and then re-open Object Spy.
  3. (Optional) In the Object tree toolbar, click the filter icon  and select the objects you want to view. By default, all objects are selected.

    Note: If you omit objects from the view using the filter, the object tree reverts to a flat structure. The hierarchical view is only available when all objects are included.

  4. In the tree on the right or on the device screen, click a detected object. The right pane now displays the object's smart locator, XPath, and other properties and associated automation functions. At the same time, the selected device on the screen is overlaid with a rectangle.

    Tip: To identify an object's parent node, move the pointer over the selected object on the device screen and click . This changes the selection to the parent node.

  5. To copy a value:
    • In the right pane, move the pointer over a value and click the copy icon .
    • On the device screen, move the pointer over the selected object and click the copy icon . This copies the smart locator to the clipboard.
  6. Paste the value into your automation script.

To download the object tree:

  • In the Object tree toolbar, click the download icon  and select the format (XML or HTML for web views). The file downloads to your browser's download pane.