The path editor | Ranorex
Help CenterUser GuideRanorex Studio advanced

The path editor

This section introduces and explains the path editor – one important part of Ranorex Spy. The path editor is where you specify and edit the RanoreXPath of tracked and identified UI-elements.

In this chapter

    Starting path editor from within Spy

    The path editor can easily be accessed from within Spy by simply selecting it in the working environment selector area.

    Accessing path editor from within Spy

    Accessing path editor from within Spy

    Select a UI-element in the browser tree view
    Click the PATH EDITOR link of the working environment selection
    See the changed path editor view with the selected UI-element in the tree view section

    Starting path editor from within Studio

    Any repository item in Ranorex Studio can be opened for editing in Spy. Here is how to do this.

    Accessing path editor from within Studio

    Accessing path editor from within Studio

    Select a repository item in the repository of Ranorex Studio

    Either click the EDIT IN SPY button of the repository item, or
    open the context menu and click Edit in Spy…

    Element could not be found

    If you open a repository item for editing in Spy there might be the problem that the corresponding UI-element could not be found by Spy. This may happen if the application hosting the UI-element is not started.

    Initial situation

    Could not find element error

    Could not find element error

    Select a repository item in Ranorex Studio
    Click the EDIT IN SPY link to open the repository item in Spy
    See Spy with the element tree indicating that the UI-elements have not been found in case the application under test is not started

    Important to know:

    The red symbols indicate that the corresponding UI-elements have not been found
    A status message at the bottom of the Spy window informs you about not finding the UI-elements

    Solution:

    Solution to UI-element not found error

    Solution to UI-element not found error

    Open the application hosting the corresponding UI-elements
    Click Refresh to update the references to the UI-elements

    Path editor working environment

    The path editor working environment consists of 4 basic areas and one important status message.

    Path editor working environment

    Path editor working environment

    Track button & RanoreXPath information. The track button is used to track, identify and add new UI-elements whereas the RanoreXPath edit line displays their unique specification and is used for editing the RanoreXPath
    Switch between UI-element tree browser and the path editor
    Tree view section: displays the components of the RanoreXPath specification in a tree-like structure
    Attribute comparison section: List of available UI-element attributes and their values with the option to select attributes to change the RanoreXPath specification accordingly
    Current UI-element identification status: informs if and how many UI-elements are identified by the current RanoreXPath specification

    Locked tree levels

    The root element of the UI-element browser tree of Spy limits the tracking and editing. All tree elements (i.e. parts of the RanoreXPath specification) above the root element of the UI-element tree browser are locked with respect to tracking and editing.

    Opening path editor from Spy

    Locked path editor tree level - part I

    Locked path editor tree level – part I

    The root element RXMainFrame in the Spy browser tree …
    …represents the root element in the tree view section of the path editor

     

    Note icon

    Note

    No element above the current root element can be tracked nor edited. In the current example, no tracking and editing beyond the application being referenced by the repository item RXMainFrameare possible.

    Opening path editor from Ranorex Studio

    Any repository item can be edited in Spy with the path editor by clicking the corresponding button in the repository.

    Locked path editor tree level - part II

    Locked path editor tree level – part II

    Select a repository item and click EDIT IN SPY to open it in the path editor of Spy
    The parent repository item will be defined as the root element of the browser tree in Spy

    Note icon

    Note

    Tracking and editing of elements above of the root element RxTabStandard are not possible.
    Locked path editor tree level - part III

    Locked path editor tree level – part III

    See the tree item representing the repository item in Spy
    The parent repository item has been declared to be the root item of the browser tree in Spy. This item represents the limit for tracking & editing
    All items above the root tree item are locked for tracking & editing (greyed font) in the path editor
    All items at and below the root tree item are free to be tracked and edited (normal font) in the path editor

    Editing the RanoreXPath specification

    The main application of the path editor is to edit the RanoreXPath specification of UI-element(s). The purpose is to make a RanoreXPath specification more specific, or more general in order to identify one, or more UI-elements doubtlessly. Therefore, the edit line and its components play an important role and need to be introduced herein after.

    Path editor line components

    Path editor line components

    The upper yellow input line represents the edit-line of the path editor. Here, editing the RanoreXPath specification is possible
    The smaller, lower path line displays the currently applied (i.e. valid) RanoreXPath specification. If opened from Ranorex Studio, this line displays the currently valid RanoreXPath specification of the corresponding repository item.
    The edit line outlines the locked part of the specification (greyed) and the editable part (colored)
    The APPLY button replaces the currently applied RanoreXPath specification (lower line) with the currently edited RanoreXPath specification (upper line), closes Spy and returns to Studio

    RanoreXPath syntax support

    The path editor provides syntax support for the RanoreXPath specification. See how it works.

    Path editor RanoreXPath syntax support

    Path editor RanoreXPath syntax support

    If you write a RanoreXPath specification and you need help, press Ctrl+Space

    A drop-down list opens with semantically possible RanoreXPath syntax parts for your selection

    Refreshing tree view

    The tree in the tree view section of the path editor can be refreshed by clicking the Refresh button in the toolbar. Refreshing is necessary and useful when the architecture of the graphical user interface (GUI) of the application under test changes.

    Path editor tree view refresh

    Path editor tree view refresh

    Verify to select the PATH EDITOR of Spy
    Click Refresh to refresh the tree view

    tipp icon

    Hint

    If the corresponding application under test is not started, the refreshing fails.

    Highlighting UI-elements

    This function highlights corresponding UI-elements in the application under test.

    Highlighting UI-elements

    Highlighting UI-elements

    Verify to select the PATH EDITOR of Spy
    Click Highlight to highlight UI-elements

    tipp icon

    Hint

    If the corresponding application under test is not started, highlighting fails.

    Selecting / deselecting path elements

    Path elements (i.e. RanoreXPath specification parts) can easily be included/excluded from the RanoreXPath specification by selection/deselection of the corresponding check-boxes of the tree nodes in the tree view section of the path editor.

    Selecting/deselcting path editor tree elements

    Selecting/deselcting path editor tree elements

    See the checkboxes to select/deselect tree items
    Re-selection of path editor tree elements

    Re-selection of path editor tree elements

    Important to know:

    Select a tree item
    Deselect the tree item
    Re-select the tree item again

    Result(s):

    • The corresponding UI-element is excluded, or included in the RanoreXPath specification
    • If a specified tree element is deselected – and re-selected again, Ranorex does not necessarily detect its initial adapter type and/or selection attribute/value
    • You may have to re-track the UI-element, or specify adapter type and attribute/value pair manually

    Specifying tree elements

    Any tree element can be specified directly within the tree view section. This section shows you how to do this! Select a tree item and open the context menu.

    Path editor specifying tree elements

    Path editor specifying tree elements

    Declaring optional: Declaring a tree element as ‘optional’ element means that Ranorex tries to specify the element(s) of the RanoreXpath independent from their relationship to the optional tree element
    Relationship operator (axis operator): An element in a RanoreXPath specification cannot only be defined by its position within the path, but also by its relationship to other (tree) elements. Possible relationship operators are:

    child: Refers to all children of the current node
    descendant-or-self: Refers to all descendants (children, grandchildren, etc.) of the current node and the node itself
    ancestor: Refers to all ancestors (parents, grandparents, etc.) of the current node
    self: Refers to the current node
    descendant: Refers to all descendants (children, grandchildren, etc.) of the current node
    parent: Refers to the parent of the current node
    ancestor-or-self: Refers to all ancestors (parents, grandparents, etc.) of the current node and the current node itself
    preceding-sibling: Refers to all siblings before the current node
    following-sibling: Refers to all siblings after the current node

    Adapter type specification:A tree element can be assigned a specific adapter type by choosing an adapter from the list of options in the context menu

    Further reading

    Application examples of RanoreXPath specification are introduced and explained in > Ranorex Studio advanced > ⇢ RanoreXPath.

    Further reading

    The concepts of adapters, attributes, and values are introduced and explained in the advanced chapter > Ranorex Studio advanced > ⇢ UI-elements.