Layout of Advanced RanoreXPath Editor

So as you know how to access the Advanced RanoreXPath Editor, you will get an overview of the structure of this editor.

As you can see you can break down the editor in three areas, the RanoreXPath shown in a tree view on the left (marked in green), the attribute equation list of the selected tree item on the right (marked in red) and a status and button section at the bottom (marked yellow).

RanoreXPath Editor used to specify UI element identification
RanoreXPath Editor

As you can see the whole path is shown in this tree structure with each path element as one node of the tree. In the left section of the editor you can access each of these path elements to alter the attributes equations in the right section on which the path is based. In the bottom section you can on the one hand verify and accordingly highlight the adapters which correspond to the path and on the other hand apply or reject the changes on the path you made. Furthermore you can inspect how many adapters correspond to the currently selected tree item shown at the bottom left of the editor.

To understand the behavior of the tree view section and the attribute equation section you should have a closer look on the sections noted above.

The Tree View Section

As described above you can see the whole RanoreXPath you want to edit mapped as a tree structure. If you for example start the VIP Database example application and add two entries, one called John Doe and the other called Jane Doe and you track the cell holding the last name of Jane Doe you will get following tree structure in the Advanced RanoreXPath Editor:

RanoreXPath structure in Path Editor for cell in second row
RanoreXPath structure in Path Editor for cell in second row
As you can see there are several check boxes before each of the tree items in your tree structure. They are used to enable and disable the attribute equations specified on the attribute equation section on the right. So by unchecking one of these check boxes the level of your path will no longer be requested and it will match all adapters:
Unchecking levels in tree view
Unchecking levels in tree view

The Attribute Equation Section

In the attribute equation section of the Advanced RanoreXPath Editor you can define the attribute value comparison which the RanoreXPath is based on. So if you want to define your adapter not by the accessible name attribute as selected by default but by the text value just uncheck the accessible name check box and check the text check box. If you now verify your path with the Verify button in the bottom section of the editor you will see that the path now corresponds to two elements, the last name cells of both Jane and John Doe, because you first have made the level in your tree structure which held the equation row[@accessiblename=’Row 1’] match all adapters and second you don’t compare the accessible name of the cell but the text value.
Two elements found in grid
Two elements found in grid
If you now highlight the UI elements corresponding to your altered RanoreXPath with the Highlight button in the bottom section of the editor you will get the result verified before visualized on your application under test:
As you can see in the attribute equation section there is a combo box for every available attribute to select the type of equation:

The following types of equations are defined:

  • =  The attributes value must be equal to the given value
  • ~  The attributes value must match the regular expression
  • != The attributes value must not be equal to the given value
  • > The attributes value must start with the given string (case sensitive)

Right now you have just used the equal operator. You can try out the other operators by yourself:

This equation will ...
This equation will ...
... return these UI elements.
... return these UI elements.

For more details about regular expression see the RanoreXPath documentation.

'Not Equal' will deliver all cells which don't contain the value 'Doe'.
This equation will deliver you both cells holding text values starting with “J”, which are the cells holding the text value John and the text value Jane.

Relationship and Attribute Example

After exploring the equation operators you are going to learn more about the combo box holding the relationship operators (marked red) and the combo box holding the attribute types (marked green).
Relationship operators and attribute types
Relationship operators and attribute types

In the combo box, holding the relationship operators, the following types of relationship are defined:

childRefers to all children of the current node
descendant-or-selfRefers to all descendants (children, grandchildren, etc.) of the current node and the current node itself

ancestor

Refers to all ancestors (parent, grandparent, etc.) of the current node
selfRefers to the current node
descendantRefers to all descendants (children, grandchildren, etc.) of the current node
parentRefers to the parent of the current node
ancestor-or-selfRefers to all ancestors (parent, grandparent, etc.) of the current node and the current node itself
preceding-siblingRefers to all siblings before the current node
following-siblingRefers to all siblings after the current node

You will now see how the relationship operators work in practice, by doing a simple example with the preceding-sibling operator and the parent operator. In this simple example you modify your path to make it refer to the whole row holding the entry Jane Doe. But before that, you first have to add a new VIP called Jane Smith in the sample application, so that we have not only one Jane in our Database on which we can refer to:

And after that you have to add two new layers in your path, one holding a cell and the other holding a row:

Now we have a cell which refers to the cells holding “Doe” as text value, a cell which will refer to the cell holding Jane as text value coming from one of the cells one layer above, and the row which is the parent of the cell one layer above again. This path won’t refer to any UI element for now. To make the path refer to the row holding Jane Doe you have to

  • open the Advanced RanoreXPath Editor again,
  • select the tree element representing the cell we added before,
  • choose preceding sibling as relationship operator,
  • add the equation, that the text value of the cell equals to Jane,
  • select the tree element representing the row we added before,
  • and choose the parent operator.
If you now verify your Path you should get one element matching your path. By highlighting the matching element you should see the row containing the entry Jane Doe.
The attribute types can be used to define the type of an attribute if it is not defined right now. So in your example if you activate the equations, of the tree item where you have deactivated them in the tree view before, again, the attribute type will be set to element. This is because the information about the attribute type of this layer is lost, thru making the layer match all types.
You can change the attribute type to the type row again, as we know that this element is a row control.

Defining Variables

If you start the Advanced Ranore Path Editor from an existing Repository you have an additional button for each attribute equation.
With these buttons you can define variables which can be used for dynamically alter the RanoreXPath. The variables you have added are then inherited from the Repository you are working on. Each of the variables held by the Repository can be taken for attribute equations.
Creating variables for repository items
Creating variables for repository items
For more details about variables used within the repository click here.

Live and Offline View

The last thing to mention is that if you are in Live View you basically get delivered more information about the adapter you are working on as not being in Live View and if you are not in Live View you can not verify or highlight the elements matching your path.

If you open the editor with opened application under test you see following attributes:

Live view of VIP Database application
By closing the application you will only see following attributes in editor for the same adapter:
Offline view of VIP Database application
Offline view of VIP Database application