My understanding is that the ActivityTestRule is designed to test only one action in the test folder, so getActivity () will only return the activity that you specified in the ActivityTestRule.
, :
View screenView = activity.getWindow().getDecorView().getRootView();
screenView.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
screenView.setDrawingCacheEnabled(false);
( - , .)
, takecreenshot, . , ?
, , .
. Firebase Test Lab, ( ), /sdcard/screenshots, .