一个屏幕上有多个水平Recyclerview
。我想在第一个水平的第一项上执行浓缩咖啡点击事件Recyclerview
。请让我知道我们如何实现它。
onView(withId(R.id.craousal_recyclerview))
.perform(RecyclerViewActions.actionOnItemAtPosition(1, new ClickOnImageView()));
public class ClickOnImageView implements ViewAction {
ViewAction click = click();
@Override
public Matcher<View> getConstraints() {
return click.getConstraints();
}
@Override
public String getDescription() {
return " click on custom image view";
}
@Override
public void perform(UiController uiController, View view) {
click.perform(uiController, view.findViewById(R.id.craousal_imageview));
}
它给了我以下例外:
android.support.test.espresso.AmbiguousViewMatcherException