Hi
Could you please help me ? I am testing android app which have ListView with id daysListView. And I want to check that new day is present in ListView. However when I get l MobileElement in my test I cannot CAST it to ListView
@AndroidFindBy(id = “daysListView”)
public MobileElement daysList;
How can I get elements from this daysList?
if all elements in daysList have same id then:-
List <MobileElement list = daysList.findElementsById(“id”);
if you just want to act on a particular element:-
daysList.findElementsById(“id”).get(index).click() / getText();
if each element in daysList have unique id then:-
daysList.findElementById(“id”).click() / getText();
You can’t cast MobileElement object to ListView, MobileElement class is in Appium framework whearas ListView class is in AndroidFramework, both belongs to different entities.