I develop automation testing using via espresso library. Sometime I ever got error message \"Could not launch intent Intent\" when running test is make long time I call view b
This probably happens when there is a progress dialog after test finishes. So your next test can't launch itself when progress dialog is active. You can prevent this by waiting progress dialog to end.
onView(allOf(withId(R.id.btnWorkingDate), withText("OPEN DAY"))).check(matches(isDisplayed())).perform(click(),closeSoftKeyboard());
long timeout = 0L;
while(timeout < YOUR_DESIRED_TIMEOUT) {
try {
onView(withId(anIdInNextScreenAfterProgressDialog)).check(matches(isDisplayed));
break;
} catch (Exception e) {
Thread.sleep(1000L);
timeout += 1000L
}
This will wait until your progress bar disappears since it waits for something in the next page