Is there any way to use "following sibling" command in xpath in android ? Appium is not able to recognise it!

I’m trying to find all the relative layout elements below a linear layout element.I used the below ommand in xpath.

//android.widget.ExpandableListView[1]/android.widget.LinearLayout[text() = ‘List of devices’]/following-sibling::android.widget.RelativeLayout

Appium is returning me " Failed to locate element "

Is this the correct syntax of using following sibling or is there any alternative way of finding those elements with any other locator strategy??

Best is to use android native selector, please refer to the doc.

@sebv : do you mean Appium node js doc link .ie. ? btw We use NodeJs webdriver implementation

should be like this:

  //android.widget.ExpandableListView[1]/android.widget.LinearLayout[@text = 'List of devices']/following-sibling::android.widget.RelativeLayout

or just:

//*[@text = 'List of devices']/following-sibling::android.widget.RelativeLayout


I tried above but did not work.

I tried above but did not work. Am I missing anything here?

Do we have any way to handle following-sibling for native android locator?