Login   /   Register

A free, external, .Net object spy

Rate this article
     4 votes, average: 3.25 out of 54 votes, average: 3.25 out of 54 votes, average: 3.25 out of 54 votes, average: 3.25 out of 54 votes, average: 3.25 out of 5
Loading ... Loading ...
June 7th, 2008 by Yaron Assa

Google Search Results

You arrived here after searching for the following phrases:

Click a phrase to jump to the first occurrence, or return to the search results.

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.

image image

Beside the usual icons for arranging the data by categories image or by alphabetical order image , the window presents several view options. You can choose to see properties image, all properties image, all fields (kind of extended properties) image, events image, methods image and process info image.

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.

Posted in Reviews, Tools

7 Responses to “A free, external, .Net object spy”

  1. jloyzaga Says:

    [-]

    so can it totally replace the QTP one?

  2. Yaron Assa Says:

    [+]

    For the most part, yes. This object spy lacks only two properties the native .net object spy has: 1. Recording events. 2. The abil... ...

  3. medwards Says:

    [+]

    I tried to download this program but when I target icon I get the following error: There was an unhandled exception:System.IO.Fil... ...

  4. maxsch Says:

    [+]

    I get same exception. Use the runtime object editor instead. It works. There is a way to view invisible objects, I would say. htt... ...

  5. sridhar_g99 Says:

    [-]

    Yaron Assa,

    Great .Net Object Spy, It’s working fine……

    Thanks for info….

    Sridhar.G

  6. qtpexpert Says:

    [-]

    can we use this object to spy properties of 16 bit applications running on windows environment.

  7. Yaron Assa Says:

    [-]

    Sorry, but no.
    It can only inject itself to .Net assemblies.

Leave a Reply

You must be logged in to post a comment.

This article was viewed 1197 times