Selecting Native Tabs while Espresso testing
问题 I have a viewpager which utilizes the native actionbar Tabs as the indicator. I would like to navigate to different tabs, but Tab component is not a view therefore, onView, or withText does not work properly with perform clicks. Is there a specific way I can do to navigate through the Tab navigation? 回答1: You could use swiping to navigate between your tabs: onView(withId(R.id.viewpager)).perform(swipeLeft()); onView(withId(R.id.viewpager)).perform(swipeRight()); 回答2: Assuming there is text on