A Free, External, .Net Object Spy
Posted by admin - Jun 7, 2008 .Net, Articles, Reviews, Utilities, Yaron Assa 0 0 Views : 1492 Receive Updates For This Category
Article Tools
- Print this page
- Add Comment
- Send to Friend
- Last Updated on :
Jul 17, 2011
Max Sch had recently brought to our attention the existence of a free, external .Net object spy, which is far superior to QTP’s internal object spy, and .Net object spy.
This new object spy is called Runtime Object Editor, and is downloadable from here (Courtesy of The Code Project).
Update: there’s a more advanced version of the project, located here.
So, what makes this object spy so special compared to QTP’s pretty impressive .Net object spy? It doesn’t hold back. While the native .Net spy will give you an object’s public properties and events, this object spy will present properties, events, methods, and “Fields”, which includes some behind-the-scenes backdoor properties, such as the underlying data layer behind public collections, etc.
So, let’s see it in action. Once you’ve downloaded and extracted the project’s archive, you start the object spy by activating RuntimeObjectEditorLoader.exe, which will present you with this basic screen. In order to spy on a .Net object, you simply have to drag the target icon from the top left corner onto the relevant object.
Beside the usual icons for arranging the data by categories
or by alphabetical order
, the window presents several view options. You can choose to see properties
, all properties
, all fields (kind of extended properties)
, events
, methods
and process info
.
Here’s from the project’s documentation:
The Properties tab simply emulates the Properties tab we normally see in Visual Studio. This Properties tab will show the properties of the object based on the attributes they have set. Some properties that are normally visible at design time only, might not be visible here. Also, properties that are marked with DesignerSerializationVisibily(Hidden) or Browsable(false) will not be visible in this tab.
The AllFields tab will show you all the fields defined in each class from the selected object’s hierarchy. The fields can be modified (unless marked as read-only).
The AllProperties tab will display all the properties defined on the objects, disregarding the attributes or visibility of the properties. The AllProperites tab also allows hierarchical navigation inside the collections by allowing you to expand them and select items you want to modify.
The Events tab will display all the events defined on an object and give you the option to view all the event listeners attached to each event, including the objects that own the event handler and the function name that will handle the event.
The Methods tab displays the object methods and allows you to invoke them.
As the number of the view options indicates, this external spy far surpasses the native .Net spy of QTP on every account. The ability to view semi-private properties via the AllProperties tab is extremely useful for understanding the flow of information within the AUT’s objects.
Its only main drawback is the inability to use it on hidden / layered controls (as you cannot visually point at them); while the native QTP spy always offers the .spy command in these cases (something like SWFWindow(“X”).SWFObject(“Y”).Spy, which opens the spy window for the relevant object once the test is run).
In short, it’s a valuable tool, which can come in handy whenever you’re exploring custom controls, or just trying to figure out what makes the AUT tick.


