Ranorex Spy functions | Ranorex
HomeUser GuideRanorex Studio AdvancedRanorex SpyRanorex Spy functions

Ranorex Spy functions

The purpose of this chapter is to introduce and explain the various Spy functions and possible applications.

In this chapter

    Element repository

    When started as a stand-alone version, Ranorex Spy offers to handle and manage self-contained repositories. The option to manage repositories is represented as ELEMENT REPOSITORY button in the main toolbar of Ranorex Spy.

    Element repository option of Ranorex Spy

    Element repository option of Ranorex Spy

    When selected, a repository window is displayed with all functions for handling and managing repositories and repository items including the loading of repositories from a disc location, the export of repositories to C#, or VB.NET code and saving repositories to disc locations.

    Ranorex spy element repository working environment

    Ranorex spy element repository working environment

    Further reading

    Repositories, their management, and application are introduced and explained in detail in > Ranorex Studio fundamentals > Repository > ⇢ Introduction.

    Ranorex Spy track function

    The track-function enables to track & identify UI-elements and store them as repository items within the current repository.

    Ranorex Spy track function

    Ranorex Spy track function

    TRACK button and RanoreXPath identifier:

    • The track button starts tracking a UI-element
    • The RanoreXPath line displays the unique identifier of the selected (i.e. tracked) UI-element

    Root UI-element

    • The root element of the UI-element browser tree limits the track function
    • Only UI-elements below the root element can be tracked
    • In the example, the button RxButtonExit is the currently selected (i.e. tracked) UI-element
    RanoreXPath editor line

    RanoreXPath editor line

    RanoreXPath specifier line in edit mode:

    • If you click on the RanoreXPath line, it changes to edit-mode
    • A red cross at the beginning and a yellow background indicate the edit mode
    • During edit-mode tracking is disabled

    End edit-mode

    • To end the edit-mode and return to the display mode, click the red X
    • The cross disappears and the background color changes to white again

    Ranorex Spy working environment selector

    The working environment selector switches between the Spy UI-element browser tree and the path editor.

    Ranorex Spy working environment selector

    Ranorex Spy working environment selector

    Further reading

    The Ranorex Spy path editor implies important applications and is therefore introduced and explained in a separate chapter in > Ranorex Studio advanced > Ranorex Spy > ⇢ Path editor.

    UI-element browser tree

    The element browser tree represents an abstract representation of the computer’s desktop GUI. Unspecified and without selection it contains all applications currently active on the desktop with all UI-elements included. The browser tree can also display a defined subset of the currently active desktop applications.

    Ranorex Spy UI-element browser tree

    Ranorex Spy UI-element browser tree

    UI-element browser tree showing ALL current desktop applications
    UI-element browser tree showing selected UI-elements of the desktop application RxMainFrame

    UI-element browser tree functions

    This section introduces and explains the various functions of the UI-element browser tree view.

    UI-element browser tree toolbar

    UI-element browser tree toolbar

    Browse endpoint & Endpoints
    Refresh
    Load from snapshot… & Save as snapshot…
    Highlight elements
    Status indicator: showing the status of the UI-element browser tree. Three different indicators are known
    Ranorex Spy UI-element browser tree status

    Ranorex Spy UI-element browser tree status

    Live view in display mode
    Live view in edit mode
    Restored mode with loaded snapshot file

    Browse endpoint & Endpoints

    • Browse endpoint shows currently running application on the active endpoint (set as automation root)
    • Browse endpoint delivers the default tree view just as if Ranorex Spy was started as a stand-alone application
    • If no specific endpoint is defined, the current host is the endpoint
    • Endpoints opens the endpoints pad which is empty if no endpoints have been defined yet
    Ranorex Spy endpoints menu

    Ranorex Spy endpoints menu

    Click the Endpoints button in the toolbar
    See the endpoint management window open

    Further reading

    Endpoints are an important topic which is introduced and explained in detail in > Web and mobile testing > ⇢ Endpoints.

    Refresh

    • Clicking the Refresh button refreshes the UI-element tree to show the current state of applications

    Load from snapshot… & Save as snapshot…

    • The first function opens an existing Ranorex snapshot file, while
    • the second function saves the current selected UI-element, all of its ancestors and all of its descendants into a Ranorex snapshot file

    Further reading

    The concept of saving a test project into a Ranorex snapshot file is introduced and explained in detail in > Ranorex Studio advanced > Ranorex Spy > ⇢ Snapshot files.

    Highlight elements

    The highlight-function works similar to the one introduced in the repository chapter. The function highlights the corresponding UI-element of the application by means of a surrounding red frame.

    Ranorex Spy highlight function

    Ranorex Spy highlight function

    Click the Highlight elements button in the toolbar to activate highlightning
    See the red frame surrounding the selected UI-element of the corresponding tree element
    tipp icon

    Hint

    Be aware that the application hosting the UI-elements is started and visible on the desktop.

    UI-element browser context menu

    In addition to the toolbar functions of the UI-element browser tree, there are numerous tree-element functions available by opening the context menu of the selected element. These functions are introduced hereinafter.

    UI-element browser tree context menu - part I

    UI-element browser tree context menu – part I

    Highlight element: function introduced in the previous section
    Update element data: function Refresh introduced in the previous section
    Set element as root: This function places the selected UI-element at the root position of the UI-element browser tree

    Set UI-element as root function

    Set UI-element as root function

    Select the UI-element of the tree which is to be placed at root position
    Open the context menu and click Set element as root
    See the former tree element set as root element
    UI-element browser tree context menu - part II

    UI-element browser tree context menu – part II

    Add to repository: adds a reference to the selected UI-element into the repository

    • The option is to add one repository item, or a complete branch with all descendants
    • If Ranorex Spy was started from within Ranorex Studio, the repository item is added to the current Studio repository
    • If Ranorex Spy was started as standalone tool, the repository item is added to the Spy repository
    UI-element browser tree context menu - part III

    UI-element browser tree context menu – part III

    Save as snapshot…: function introduced in the previous section
    Capture screenshot: captures a screenshot for the current UI-element to be further used within image-based validation

    • The UI-element must be valid and active; if necessary, a refresh is needed to make the UI-element valid
    • The taken screenshot is opened in the Ranorex image editor
    • The screenshot is by default stored within the folder /Ranorex/Repositories/ in PNG file format
    • Saved screenshots can also be used for image comparison in code, for example for finding and comparing images or image-based automation

    UI-element details

    The UI-element details area lists all properties and attributes of a corresponding UI-element.

    UI-element details area

    UI-element details area

    Primary adapter & name of UI-element

    • Additionally, information about the size and position of the UI-element on the desktop are displayed
    • Values are given in pixels and within the x-y coordinate system

    Switch to select the displayed details of UI-element properties and attributes
    Information window with UI-element properties and attributes

    Further reading

    The concept of UI-elements contains the introduction and description of UI-element properties and attributes as well as the concept of adapters. Please refer to > Ranorex Studio advanced > UI-elements > ⇢ Introduction.

    Edit path weights… is an expert topic regarding the mapping of dynamic UI-elements

    Further reading

    The expert topic of editing path weights in order to map dynamic UI-elements is introduced and explained in > Ranorex Studio expert > Mapping dynamic UI-elements > ⇢ Introduction.

    Image navigation area

    The image navigation area enables to browse through the UI-elements of the browser tree by navigating through the displayed (screenshot) image(s).

    Image navigation area

    Image navigation area

    Click on a UI-element in the screenshot
    See the corresponding tree element being selected

    Important to know:

    • At the top of the image navigator you can see the primary adapter type and the name of the currently selected UI-element
    • By moving the mouse over a specific child element of the currently selected element, you will see the adapter type and its name
    • Clicking a UI-element selects it
    • Double-clicking outside the selected element selects the parent of the UI-element