Ranorex Spy is the component of Ranorex Studio that makes it possible to explore and analyze the UI of desktop, mobile, and web applications to identify UI elements. Spy captures all running applications (according to your whitelist) and displays them and their subelements in a tree view. It therefore recognizes UI elements, identifies them, assigns a RanoreXPath to them, and ultimately makes them available as repository items to Ranorex Studio.
Related chapters
Ranorex Spy is an advanced topic that is closely connected to the concepts of RanoreXPath and UI elements. Together, they explain how UI element identification in Ranorex Studio works. Therefore, it is recommended you also study these chapters.
- Ranorex Studio advanced > RanoreXPath
- Ranorex Studio advanced > UI elements
Spy is available integrated into Ranorex Studio and as a standalone tool.
Integrated Spy
a. In the Ranorex Studio toolbar, click the Spy icon.
b. Click View > View Spy.
c. In a repository, click EDIT IN SPY next to a selected repository item.
d. Open Ranorex Spy from the Start Menu (Standalone version).
Ranorex Spy layout
In the image below, you can see the layout of the standalone Spy with the BROWSER & RESULTS tab active. The areas framed in green change when selecting PATH EDITOR instead. These areas are explained separately as part of the pages Browser & results and Path editor.
The areas in red are fixed and explained further below.
-
Element browser/repository selector (standalone only)
Switches between the element browser and the repository. Loading repository files (.rxrep) is only possible in the standalone Spy. -
Track button and RanoreXPath field
The track button lets you track, identify, and add new UI elements. The RanoreXPath field displays the RanoreXpath of an element and also lets you edit it. -
Switch between browser & results screen and the path editor
These are explained separately on the pages⇢ Browser & results and ⇢ Path editor. -
UI-element tree view
This hierarchical tree structure represents all running applications (depending on whitelist settings) and their UI structure. -
UI-element details
Selecting a UI element in the tree displays detailed information about it in this section. -
Image navigation area
Displays a selected UI element as it would appear in the application and can be used to navigate through the UI.
Element browser/repository selector
Only available in the standalone version of Spy. Lets you switch between the element browser and the repository view.
In the repository view, you can load and manage repository files (.rxrep). This is particularly useful when you want to add repository items to a repository on a computer where Ranorex Studio isn’t available.
The repository view is the same as in Ranorex Studio and has all the same functions.
Managing repositories is explained in Ranorex Studio fundamentals > Repository.
Track function
Ranorex Spy has a track function that lets you identify UI elements and add them to the element tree, from where you can then add them to your repository.
-
TRACK button and RanoreXPath field:
- The track button starts the tracking process.
- The RanoreXPath field displays the RanoreXPath of the tracked UI element
-
Root UI element
- You can only track UI elements that are contained in the root element.
- In the example, the RxMainFrame (The Ranorex Studio Demo Application) is the root element and the button RxButtonExit is the tracked UI element. This means that tracking a button in the Windows Calculator would not work because it’s a separate application. If the root was the entire endpoint, it would work.
RanoreXPath field
3. RanoreXPath field in edit mode
- Normally, the RanoreXPath field is white and displays the RanoreXPath of the element currently selected in the tree.
- When you click in the field and press Enter, it changes to edit mode. This is indicated by a red X, yellow background, and a message below the field.
- You can now change the RanoreXPath and press Enter again and the element tree will display all elements that match this path.
4. Exit edit mode
- Clicking the red X exits edit mode.
Working environment selector
The working environment selector lets you switch between the browser & results screen and the path editor.