Unable to identify UI Elements in android

Using Appium for automating Android Native app.

I am identifying elements using android UIAutomator

Issue : I have eleven android textview fields which changes daily.

Issue is i am unable to read their values as all the eleven fields have same classname and same resource -id.

Then i tried using Xpath but what i saw was when i navigate to the
textView all the textviews have same index value resulting in all 11
textviews have same Xpath.

Now i am unable to identify elements. Kindly suggest.

You can put all these elements in a list and access them based on order.
java example:

List<WebElement> dailychanged=driver.findElementsById("resource-id of your elements");
for (int i = 0 ; i < 11 ; i++){
    System.out.println(dailychanged.get(i).getText())
}
2 Likes

yes earlier i did the same thing but five element are on screen and for other 6 elements we need to scroll down.
data changes daily some times there are 11 list views and sometimes more.how much scroll requires is based on number of listview items and i am unable to access and store all listview items in list since the elements in list have only those elements which are visible(i.e which are captured by uiautomator) on the screen.
kindly suggest .
Regards

If your textviews are children of listviews and those listviews have different index numbers, you may be able to use UI Selectors … along with a complex scrolling method. Try to search for other topics about finding invisible elements, this really is your main problem here.