
With the new "HotTracker" feature all dynamically generated controls, control elements or popup menus can be analyzed.
RanorexSpy is a Win32-based utility that gives you information about a selected GUI element. Download and use RanorexSpy to see which kind of GUI elements could be automated with Ranorex.
In most cases, you have two possibilities to manipulate an element of a control. You can call the functions of special control classes or you can use the general functions of the element class. For instance, you can click a checkbox with CheckBox.Click() or CheckBox.Element.DoDefaultAction().
With RanorexSpy you can find the properties of a selected item as follows:

RanorexSpy shows the following properties of elements:
Control Box | |
| Entry | Description |
| Handle | The unique ID of this window or control. Window handle numbers are reused; they identify a window only for the lifetime of that window. That's why one cannot use this property to find a window or control. The display mode can be switched between hex or decimal. Most of the RanorexCore functions work with handles. You can use them to check the return value of functions. |
| Caption/text | The text in the window caption or text contained in a window if it is a control. |
| Class name | The name and instance number of the window or control class. |
| Control name | The name of the control. Controls don’t have names in older windows applications. If a control has a name, you should search for the control by its control name with the FindName function. If the name field is empty, you should search for the control by its control ID. |
| Control Id | If the window being displayed is a child window, the control ID label is displayed. |
| Style | A combination of class style codes. |
| Rectangle | The rectangle surrounding the window. The size of the rectangle is also displayed. Units are pixels in screen coordinates. |
Element Box | |
| Entry | Description |
| Role | The Role property describes the type of a user interface element. All elements have a Role property. In many cases the object's role is obvious. For example, windows have the Window role and push buttons have the PushButton role. The Role property is retrieved by calling Control.Element.Role in C# code. The role constants are defined in the enumerator Role. |
| Name | The Name property is a string used to identify, find, or announce an element. All elements support the Name property, but the Name property can also be empty. For example, the text on a button control is its name, while the name for a list box or edit control is the static text that immediately precedes the control in the tabbing order. Even graphic objects that do not display a name provide text when queried for the Name property. The Name property is retrieved by calling Control.Element.Name in C# code. An element's name should be intuitive so that users understand the object's meaning or purpose. The Name property should be unique relative to any sibling objects in the parent. |
| Class | The Class property shows the class name of the element. |
| Position | The Position property shows the screen location of an element, the coordinates of the specified object's surrounding rectangle. If the object is not shaped like a rectangle, the method returns the coordinates of the smallest rectangle that encompasses the entire object. |
| Value | The Value property provides a textual representation of the visual information contained in an element. Not all objects support the Value property. The Value property is retrieved by calling Control.Element.Value in C# code. The Value property tells the client about the visual information contained in an element. For example, an edit control's value is the text it contains, whereas a menu item has no value. |
| State | The State property describes an object's state at a moment in time. All objects support the State property. The State property is retrieved by calling Control.Element.State in C# code. The State enumerator provides constants that are combined to identify an element's state. |
| Default action | Shows the default action associated with this element. |
The most impotant properties for use in automating software are Role and Name. The Role and Name combination should be unique for each GUI element belonging to the same control.
Check the Role and Name property of the elements in your application. If the elements have no Name, discuss the problem with the developer. They should set the "Accessibility Name" property for all elements.
However, if for some reason two GUI elements in a window have the same Role and Name, the additional property Class can be used to uniquely identify the element.
Use the function Element.FindChild to search an element in a control. FindChild searches recursively for each element, it retrieves the role, name and class name for each element and compares them with the requested arguments. If there is a match, FindChild returns an element.
One of the most important function is DoDefaultAction if you want to manipulate an element.
A default action is defined for each GUI element role. For instance, the default action for a Button is "push this button", and for a selected checkbox it is "uncheck".
RanorexSpy shows the default action for each element, but not all elements support a default action.
Announcements