Legacy | Perfecto IDE object locator

In the Perfecto IDE, the Object Spy is an automation tool used to view detected objects retrieved from the device screen in a webpage, native, and hybrid applications. It displays their associated functions. The Object Tree enables a view of all objects retrieved from the webpage.

Object Spy includes XPath support for web, native, and hybrid applications, providing an intuitive, standard way of working.

Use the Object Spy

  1. Access the Object Spy by clicking the Spy icon located in the common functions menu.
  2. Click a detected object to view the object properties and values, and its associated automation functions.
    The XPath is automatically generated. If the object has an ID, the XPath is based on the ID; otherwise, the full path in the tree is used.
  3. Select an automation function to use.
  4. Edit any necessary parameter field values (For example: Text parameter in Webpage.Edit.Set or Application.Edit.Set).
  5. Click Add to add it to your Automation script.

Search and export

Use the Find Objects section to locate an object by its XPath.
Use the Export icon to export the object tree to a separate window for added convenience in HTML or XML format.

Add a new command

When adding a new command to your automation script using the Object Spy feature, the parameter values populate according to the specific function parameters. Associated values will be inserted automatically.

Smart XPath locator

The Object Spy displays the selected UI Element's attributes in the lower section. In addition, the "Object Locator" property field is a suggested smart XPath for the selected UI Element.

Be sure to set the Application Framework setting of the Perfecto Lab (shown from the More > Settings dialog) to the proper framework to get the appropriate smart XPath for your script.

Web objects

Use the Object Spy to identify web objects available on the device screen. By default the object is identified by XPath. Additional ways to identify an object are by the following object properties: CSS Selector, HTML id, name, class, tag, text and webView.
To change the default behavior to CSS Selector, go to the IDE >More > Settings > Automation and check "Identify objects by CSS Selector when available".

When using the CSS Selector, copy and paste the CSS Selector value to the Element identifier parameter value; and set the By parameter to CSS selector. For HTML id, name, and class enter the relevant value.

Note:
  • Static text elements cannot be identified with CSS Selector. Also, the generated CSS Selector is not unique and may match more than one element.

  • Native object support is available when working with web and web portion of hybrid applications.

Export device objects

Use the Export tool within the Object Spy to open a separate browser tab that includes the webpage in HTML format.

Recommended: Open the HMTL in Firefox. Firebug and FirePath Firefox add-ons are useful when working with web elements.

Work with alternative browsers

IE - Internet Explorer Developer Toolbar and Bookmarklets
Chrome - XPath Helper

Useful tutorials

For XPath, click here. For CSS, click here.