I’m trying to click on a popup menu particular element but unable to do so as all the 9 elements in the popupmenu item has same name android.widget.CheckedTextView:id/text1
and clicking on index 3 is not working from the code below:-
@AndroidFindBy(className = “android.widget.CheckedTextView”)
private List menu_items;
@AndroidFindBy(className = “android.widget.CheckedTextView[@text=‘Last Updated’]”)
private List lastupdated;
public void lastupdated()
{
System.out.println("Total "+menu_items.size()+" items found in Filter List");
for(MobileElement item:menu_items)
{
if(menu_items.get(3)==lastupdated)
lastupdated.get(3).click();
}
How to click on Lastupdated menu item placed on index 3.?
Its gives error as Index 3 out of bounds 0