You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
essentially, Facebook screenshotter does the below, plus they call dir.setWritable(/* writeable = */ true, /* ownerOnly = */ false); and they grant permissions if needed.
These must be absolute paths under /sdcard, /storage, or /data/local/tmp
Steps to Reproduce
run Screenshot.capture().process() in a test on API 23 virtual device on FTL
Expected Results
Saves screenshot to disk.
Actual Results
Exception.
E/TestRunner(6545): Caused by: java.io.IOException: The directory /storage/emulated/0/Pictures/screenshots does not exist and could not be created or is not writable.
E/TestRunner(6545): at androidx.test.runner.screenshot.BasicScreenCaptureProcessor.process(BasicScreenCaptureProcessor.java:72)
E/TestRunner(6545): at androidx.test.runner.screenshot.ScreenCapture.process(ScreenCapture.java:140)
E/TestRunner(6545): at androidx.test.runner.screenshot.ScreenCapture.process(ScreenCapture.java:126)
E/TestRunner(6545): ... 34 more
AndroidX Test and Android OS Versions
AndroidX test 1.3.0, API 23
The text was updated successfully, but these errors were encountered:
Description
BasicScreenCaptureProcessor
uses a deprecated method (Environment#getExternalStoragePublicDirectory
) for storing screenshot files.I know that
BasicScreenCaptureProcessor
might be deprecated someday... (see #383), but would be nice if it worked in the mean time.android-test/runner/android_junit_runner/java/androidx/test/runner/screenshot/BasicScreenCaptureProcessor.java
Lines 52 to 54 in 7a8e7b7
Can use the logic from Facebook screenshotter, which seems to work accross API 23-30 on FTL
essentially, Facebook screenshotter does the below, plus they call
dir.setWritable(/* writeable = */ true, /* ownerOnly = */ false);
and they grant permissions if needed.Any solution should be compatible with the FTL
directories-to-pull
optionSteps to Reproduce
run
Screenshot.capture().process()
in a test on API 23 virtual device on FTLExpected Results
Saves screenshot to disk.
Actual Results
Exception.
AndroidX Test and Android OS Versions
AndroidX test 1.3.0, API 23
The text was updated successfully, but these errors were encountered: