Current screenshot capturing for Android in Native View when calling driver.getScreenshotAs(…) works in such way that Appium Server is executing these adb command:
info: [debug] executing cmd: C:\android-sdk\platform-tools\adb.exe -s 5200f3114120c2d5 shell "/system/bin/rm /data/local/tmp/screenshot.png; /system/bin/screencap -p /data/local/tmp/screenshot.png "
info: [debug] executing cmd: C:\android-sdk\platform-tools\adb.exe -s 5200f3114120c2d5 pull /data/local/tmp/screenshot.png “C:\SecretTemporaryLocation\appium11664-11492-1xftly0.png”
This is not so good, as pulling screenshot from device is quite time consuming operation.
On big resolution devices it can take 10+ seconds.
If Appium server would create unique name for each screenshot then we could collect screenshot in background (in separate thread) and it would a huge increase in test execution time
For games testing it is must have feature as currently we can only guess about maximal time which is needed for screenshot capturing and during that time we can miss next test step as there were gameplay changes which were not captured as driver was waiting for screenshot not for these expected UI changes.
What do you think about such a feature?