Here is the code stub.
Select a data item ListView. It works like the Chrome Custom tab was designed and opened:
onData(anything()).inAdapterView(withId(R.id.listView))
.atPosition(0).perform(click());
Pause(5000);
Espresso.pressBack();
It may not seem that something appreciated on the tab or even pressed the return button of the device. Getting this error
Error : android.support.test.espresso.NoActivityResumedException: No
activities in stage RESUMED.
You forgot to start this operation. ( test.getActivity()or similar)?
source
share