I was seeking for test frameworks for Android UI automation and I stumbled upon UI Automator
and Espresso
and this is the part I am confused about -
- Both are maintained by Google
- Both are used for functional UI testing
- Both are
Android
only frameworks
So my questions/doubts here are -
- What is the major difference between
UI Automator
andEspresso
? - Will the source code have to be modified to integrate any of these frameworks?
- Does one framework hold any advantage over the other? If yes, then which framework is the most suitable for UI automation of an Android app?
When using UIAutomator you must use an 18+ API while with Espresso, you can go as low as API 8.
As the Android documentation states, multi-application tests should be done with UIAutomator while if you only want the tests to run inside of your own app package you can use Espresso.
At the bottom of this documentation's page, you can find the introduction, as well as examples to both of these testing styles.