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.
This is how the screen looks like in UI Automator Viewer:
I want to get all the relative layouts (marked in red - sixteen items)
I tried the following:
List<WebElement> webElementslist =
mAppDriver.findElementsByXPath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.ViewAnimator[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]");
But I didn't get any items.
I searched the web and found the next xpath tutorials, tried more options, but again with no success.
http://www.zvon.org/comp/r/tut-XPath_1.html#intro
Would appreciate any help.