The Object Spy allows you to inspect an object's properties and state.
Many controls on User Interfaces are compound objects or there may be many instances of a similar object. To be sure to select precisely the correct object, or to select the correct object from a collection of similar objects, the object's properties can be used to further identify the correct instance.
To spy on an object choose the type of Object Spy that you want to use. This can be done by using the menu
Tools > Spy > ... or by clicking the down-arrow next to the Spy icon in the toolbar:
There are 6 types of Spy available:
- Accessible - This is used to inspect applications that expose their properties using the Microsoft Active Accessibility (MSAA) technology. This is typically used by applications written in MFC, ATL, Qt, C++ and Visual Basic.
- Java - This is used to inspect applications written using the Java AWT and Swing UI frameworks.
- Managed - This is used to inspect applications written in .NET 1.1, .NET 2.0, .NET 4.0 using Microsoft Windows Forms.
- Mobile - This is used to inspect mobile applications running on iOS or Android devices as well as the iOS or Android simulator.
- UIAutomation - This is used to inspect applications that expose their properties using the Microsoft's newer UIAutomation technology. This is typically used by applications written in WPF, Silverlight and Java SWT.
- Web - This is used to inspect Web application running in browsers: Internet Explorer, Chrome, Firefox or any browser accessible via Selenium.
For more details on each Spy type, refer to specific topic above.
- Click the Start Tracking button (or press Ctrl+G (or Ctrl+T in Web Spy).
- As your mouse moves over different objects, you will see the contents of the Object Spy dialog change as it collects information about the object.
- Mouse over the object you wish to spy on and press Ctrl+G. The reduced-size tracking dialog will be expanded into the the larger Object Spy Dialog, presenting all the available information for the object.
- See the Object Spy Dialog for more details.