Relational Accessor Functions
The relational accessor functions specifiy that elements should be searched for in relation to a specified element.
IN
in is a DOM relation API that mentions that the element should be searched within another element.
Example:

near
The near API is a DOM relational marker that specifies that the element should be searched near another element.
The near accessor works best when you are looking for an element within the proximity of the selected reference point.
The near accessor identifies the center point of the nearby elements and calculates the distance between the center point of the reference point and the nearby objects in all directions.
Example

On this example page, the reference point is the highlighted link “Label page“.
- If you want to use the near accessor to reach the nearest object, use :
link(0,near("Label Page")) - That will identify “Headings test“ as the nearest object
- If you want to locate the second nearest object, use:
link(1,near("Label Page")) - This will identify “Take Page screenshot test“ as the nearest object.
- The number used before the near statement (
#,near) determines the order in which the system will go and find near objects. - The _near and _below locators use x,y coordinates

JavaScript Example
navigateTo("https://www.apple.com/");
_click(_link("ac-gn-link ac-gn-link-mac"));
_click(_link("ac-gn-link ac-gn-link-iphone",_near(_link("/ipad/"))));
_click(_link("/ipad/"));
_click(_span("chapternav-label[1]",_near(_link("/ipad/"))));
above / below
Just like in and near - above, below, rightOf, and leftOf can be used as relational accessors to give you more options to make the accessor or the step more robust.
This mostly would be useful in working with tables.
Syntax
Syntax is same as in and near relational API's.
_rightOfcell("Tote",_rightOf(strong("Type"))) _leftOfstrong("Type",_leftOf(cell("Tote"))) _abovestrong("Type",_above(strong("Size"))) _belowstrong("Size",_below(strong("Type")))

Exported JavaScript
navigateTo("https://demosite.appvance.com/"); click(span("Ruby on Rails Tote")); setDescription("Using in Relational Accessor"); click(span("Products",_in(link("/products")))); click(span("Ruby on Rails Tote")); setDescription("Using rightOf Relational Accessor"); assertExists(cell("Tote",_rightOf(strong("Type")))); setDescription("Using leftOf Relational Accessor"); assertExists(strong("Type",_leftOf(cell("Tote")))); setDescription("Using above Relational Accessor"); assertExists(strong("Type",_above(strong("Size")))); setDescription("Using below Relational Accessor"); assertExists(strong("Type",_leftOf(ds.cell("Tote"))));
rightOf / leftOf
Just like in and near - above, below, rightOf, and leftOf can be used as relational accessors to give you more options to make the accessor or the step more robust.
This mostly would be useful in working with tables.
Syntax
Syntax is same as in and near relational API's.
_rightOfcell("Tote",_rightOf(strong("Type")))
_leftOfstrong("Type",_leftOf(cell("Tote")))
_abovestrong("Type",_above(strong("Size")))
_belowstrong("Size",_below(strong("Type")))

Exported JavaScript
navigateTo("https://demosite.appvance.com/");
click(span("Ruby on Rails Tote"));
setDescription("Using in Relational Accessor");
click(span("Products",_in(link("/products"))));
click(span("Ruby on Rails Tote"));
setDescription("Using rightOf Relational Accessor");
assertExists(cell("Tote",_rightOf(strong("Type"))));
setDescription("Using leftOf Relational Accessor");
assertExists(strong("Type",_leftOf(cell("Tote"))));
setDescription("Using above Relational Accessor");
assertExists(strong("Type",_above(strong("Size"))));
setDescription("Using below Relational Accessor");
assertExists(strong("Type",_leftOf(ds.cell("Tote"))));
If you have any feedback on this topic, please contact us at documentation@appvance.ai