The shift towards mobile platforms is a strong trend currently and Android is the most widely adopted mobile OS with an estimated market share above 80% in 2014. You should naturally test all the apps developed for Android and a large number of open source testing tools and test automation frameworks have been developed to achieve this goal.
This article presents a list of open source Android testing tools. For each tool you will get a small description of its features and pointers to additional resources that discusses the tool more in details. Feel free to suggest any additional open source Android software testing framework or resource that you think might be included in this article. Tools are listed by alphabetical order. A list of open source projects that are not active is also included at the end of the article.
The open source Android software testing tools mentioned in this article are: Android Test Kit, Appium, AssertJ Android, Barista, calabash-android, Cortado, Green Coffee, Macaca, Magneto, Mobly, Monkey, Robolectric, RoboSpock, Robotium, UIAutomator, Selendroid, Test Butler
November 30 2017: updated Android Test Kit; removed AndroidJUnit4, NativeDriver; added Barista, Cortado, Green Coffee, Macaca, Mobly
January 24 2017: removed MonkeyTalk (acquired by Oracle); added AssertJ Android, Magneto, Test Butler
Android Test Kit
The Android Test Kit is the set of Google open source testing tools for Android. This library provides a set of APIs that allow you to quickly build and run test code for your apps, including JUnit 4 and functional user interface (UI) tests. You can run tests created using these APIs from the Android Studio IDE or from the command line.
Appium is an open source test automation framework for use with native and hybrid mobile apps. Appium drives iOS and Android apps using the WebDriver JSON wire protocol. Appium’ philosophy is that testing native apps shouldn’t require including an SDK or recompiling your app. Appium aims to automate any mobile app from any language and any test framework, with full access to back-end APIs and DBs from test code. You can write tests with your favorite development tools with the Selenium WebDriver API and language-specific client libraries.
Web site: http://appium.io/
AssertJ Android is a set of AssertJ assertions geared toward testing Android. Writing tests is not the most glamorous part of developing an Android application but it is an invaluable one. Using libraries like JUnit and AssertJ provide a great starting point for writing tests. This library is an extension of AssertJ which aims to make it even easier to test Android.
Barista makes developing UI test faster, easier and more predictable. Built on top of Espresso, it provides a simple an discoverable API, removing most of the boilerplate and verbosity of common Espresso tasks. You and your Android team will write tests with no effort.
Calabash enables you to write and execute. Calabash is an open source tool to write automated acceptance tests of mobile apps that supports Android and iOS native apps. Calabash consists of libraries that enable test-code to programmatically interact with native and hybrid apps. The interaction consists of a number of end-user actions. Calabash could be compared to Selenium WebDriver. However, it is important to realize that interacting with a web app from a desktop computer is vastly different than interacting with a native app using a touch screen. Calabash provides APIs that are specialized to native apps running on touch screen devices.
* A better way to test Android applications using Calabash
* Calabash Android: query language basics
Cortado is an open source software testing framework for Android that provides a layer of abstraction above Espresso, so it’s a bit easier to use. As there is Google Espresso underneath, you can still mess up your tests the same way you would when using pure Espresso. Cortado just gives you a bit nicer way to communicate with Espresso.
Web site: https://github.com/blipinsk/cortado
Green Coffee is an open source Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests using the step definitions that you declare. Features are written using the Gherkin language. Each feature consists of one or more scenarios that describe different situations in order to test that feature. Each scenario consists of steps that will simulate user interactions with the UI.
Macaca is an open-source automation test solution for native, hybrid, mobile web and web application on mobile and desktop platforms. Macaca is “cross-platform”. It means you can use the same API to write test scripts, and same test scripts to test your apps running on devices such as iOS, Android or desktops. Macaca doesn’t limit what languages you will use to write your tests.
Web site: https://github.com/alibaba/macaca
Magneto is an open source test automation framework that allows to write smart and powerful tests for Android apps. Magneto was built by Automation Engineers for Automation Engineers out of necessity for a mobile centric test automation framework that’s easy to setup, run and utilize. Magneto is written in Python for Android devices. It utilizes the uiautomator tool via a Python wrapper and pytest as a test framework. Magneto can be triggered from CLI, IDE and CI.
Web site: http://getmagneto.com/
Mobly is a Python-based test framework that specializes in supporting test cases that require multiple devices, complex environments, or custom hardware setups. Mobly can support many different types of devices and equipment, and it’s easy to plug your own device or custom equipment/service into Mobly.
The Monkey is a open source software testing tool developed by Google that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test your apps in a random yet repeatable manner. The Monkey is a command-line tool that that you can run on any emulator instance or on a device. It sends a pseudo-random stream of user events into the system, which acts as a stress test on the application software you are developing. Monkey generates events and sends them to the system. It also watches the system under test and looks for three conditions, which it treats specially.
Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app. Tests run inside the JVM on your workstation in second. Robolectric handles inflation of views, resource loading, and lots of other stuff that’s implemented in native C code on Android devices. This allows tests to do most things you could do on a real device. It’s easy to provide our own implementation for specific SDK methods too. Robolectric lets you run your tests on your workstation, or on your Continuous Integration environment in a regular JVM, without an emulator.
RoboSpock is an open source test framework for Android that provides an easy way of writing Behavior Driven Development (BDD) specifications with Groovy language and supports the Google Guice library. It combines two main solutions in the area: Robolectric and Spock framework.
Web site: http://robospock.org/
* RoboSpock – Behavior Driven Development (BDD) for Android
Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities.
Web site: https://code.google.com/p/robotium/
* Robotium – Testing Android User Interface
* Android user interface testing with Robotium – Tutorial
The UIAutomator testing framework lets you test your user interface (UI) efficiently by creating automated functional UI test cases that can be run against your app on one or more devices.
Web site: http://developer.android.com/tools/help/uiautomator/index.html
* Automatic Android Testing with UiAutomator
Selendroid is a test automation framework that drives off the UI of Android native and hybrid applications (apps) and the mobile web. Tests are written using the Selenium 2 client. Selendroid can be used on emulators and real devices and can be integrated as a node into the Selenium Grid for scaling and parallel testing.
Web site: http://selendroid.io/
* Mobile Test Automation with Selendroid
* Road to setup Selendroid and create first test script of android application
* Up and running with: Selendroid
Test Butler is an open source Android testing tool developed by LinkedIn. Test Butler is a two-part project. It includes an Android library that your test code can depend on, as well as a companion Android app apk that must be installed on your Android emulator before using Test Butler. You can build the Test Butler APK yourself from source, or download the binary from Bintray.
Web site: https://github.com/linkedin/test-butler
* Open Sourcing Test Butler, Reliable Android Testing, at Your Service
* “Your Espresso, Sir!”, or Stepping Up Your UI Tests With Test Butler
Some discontinued projects of Android testing tools
A list of some seemingly discontinued open source projects (or at least not updated in recent months) for Android testing tools that you might want to check… and maybe taking back to life.
Emmagee is a practical, handy performance test tool for specified Android App, which can monitor CPU, memory and network traffic. Additionally, it also provides several cool features such as customizing interval of collecting data, rendering real-time process status in a floating window, and much more.
Web site: https://github.com/kevinkong/Emmagee
NativeDriver is an implementation of the WebDriver API that drives of the UI of a native application rather than a web application.
Scirocco is an open source Application testing tool from Sonix. You will be able to access necessary testing devices from Eclipse. Instead of hand operation, Scirocco provides automatic Android application’s testing functionalities. It supports Google NativeDriver and AndroidDriver as main testing library.