I am testing my Android application using Appium framework. I have an android screen that doesn\'t have ids for its views (and I don\'t want to add...), so I thought using Xpath
Keeping in mind the fact that //foo[1]
returns all foo nodes which are the first children of a their parent (not the first child of the foo node) try something like this:
//ScrollView/LinearLayout/LinearLayout[2]/LinearLayout/RelativeLayout
Not tested, but it should give you all the RelativeLayouts which are a child of a LinearLayout which is a child of a LinearLayout which is the second child of a LinearLayout which is the child of a ScrollView.