How do I detect a view that I have created programmatically in espresso
问题 I have this line of Espresso test code: onView(withId(R.id.rvWorkDaySchedule)).perform(swipeDown()); And rvWorkDaySchedule is shown in red in the editor of Android Studio because there is no such XML view id in the layouts - I create this RecyclerView programmatically. So how do I detect views that have been inflated programmatically with Espresso? 回答1: First of all, Espresso allows you to use Hamcrest matchers in tests. Hamcrest 1.3 Quick Reference. The most useful for catching the