当我使用 Robotium 单击可扩展列表视图的第一项上的图像时,如下所示:
ListView listview = getCurrentListView().getChildAt(1); //get feed listview.
for(ImageView view : solo.getCurrentImageViews(listview))
{
if(view.getId() == R.id.image) //all images in the feed listview shares the same ID.
{
solo.clickonview(view);
break; //get the first image then break the loop.
}
}
可展开的列表视图滚动。使用 logcat,我敢肯定,我得到了第一张图片。但是当solo.clickonview 时,它不起作用,并且listview 开始滚动到最后一个。为什么会这样?
有什么方法可以完成这个场景吗?