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, AndroidJUnit4, Appium, AssertJ Android, calabash-android, Magneto, Monkey, NativeDriver, Robolectric, RoboSpock, Robotium, UIAutomator, Selendroid, Test Butler
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 that include the Espresso API that you can use to write concise and reliable Android UI tests
Web site: https://code.google.com/p/android-test-kit/
* Android application testing with the Android test framework – Tutorial
* Espresso for Android is here!
AndroidJUnit4 is a framework that allows to run JUnit4 tests on Android devices with Eclipse/ADT or command line tools.
Web site: https://github.com/esmasui/AndroidJUnit4
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.
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
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/
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.
NativeDriver is an implementation of the WebDriver API that drives of the UI of a native application rather than a web application.
Web site: https://code.google.com/p/nativedriver/
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
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.