ListViewアイテムをクリックする一般的な方法でUIAutomatorテストケースを実装しようとしています(リストアイテムを保持しているビューグループのタイプに関係なく)。
現在、次のコードがありますが、最初の項目をクリックし続けます。
public void clickListViewItem(int index) throws UiObjectNotFoundException {
UiObject listview = new UiObject(new UiSelector().className("android.widget.ListView"));
if(index <= listview.getChildCount()){
listview.getChild(new UiSelector().index(index)).click();
}else{
throw new UIObjectNotFoundException("Index is greater than listSize");
}
}