
This library contains a Screenshot class and capture() method that we’re gonna need.
SIMPLE SCREENSHOT EDITOR ANDROID ANDROID
The solution I found is simply… using Android Support Test Library. Well, first of all, Android 4.3 is a minimum system version we need to have in our project, because we are gonna be using UI Automator under the hood. I decided that this was too much for a simple operation like taking a device screenshot, so I began to research for a better solution. One guy from my project spent a few days to manually fix some code inside the library to make it work on Windows 10.

These libraries were honestly a pain in the ass, completely impossible to set up and use in a long term. I’ve worked on a few projects that used screenshot testing and these test were always dependent on external libraries like Karumi Shot or Facebook Screenshot Tests For Android. I really like this, because if you run this UI/Screenshot Test every time before creating a new pull request, you can easily check if you didn’t change something in the UI by mistake. One of many ways of using this mechanism is to test the UI and take screenshots of every screen in our app. On Android we have also Instrumentation Tests - tests that run on physical devices and emulators, and they can take advantage of the Android framework APIs and supporting APIs, such as AndroidX Test. You must write them to ensure that a particular part of the code is working.

The most basic tests for any application are Unit Tests. See the original article on my website: Ways of testing on AndroidĮvery good Android application should be well tested to minimize the risk of error after releasing it to the world.
