Back to Resources


Posted June 10, 2016

Open Source Tools - Robotium Android & Appium

Robotium is a popular Android automation framework for testing native and hybrid Android apps.


Open Source Tools - Robotium Android & Appium

Is Robotium Android in line with mobile testing best practices?

There are many automation tools for Android available, and choosing one can be a difficult task. Robotium is a popular Android automation framework for testing native and hybrid Android apps using the black box method. Licensed under an Apache 2.0 license and first released in 2010, Robotium has strengths and weaknesses just like any other framework.

We’ll look into how Robotium Android testing works, and discuss how it differs from Appium, the cross-platform mobile automation framework the powers mobile testing on Sauce.

Robotium aims to make writing tests for simulating user actions such as touching, clicking, and typing simple. It can be used if you have the source code for the app or if you only have the apk files, and can run on either emulators or real devices. To use Robotium, you need either the source code or apk file for the app, Eclipse for building a test project, ADT (Android Development Tools), SDK (Software Development Kit), JDK (Java Development Kit), and the Robotium.jar file.

Robotium is a popular framework for running automated Android tests because of its ease of use, fast execution, and readability of tests, and because you can develop powerful test cases with minimal knowledge of the application under test. Robotium Android tests are robust because of the run-time binding to GUI components. However, there are a number of aspects in which Robotium does not excel, and it’s for these limitations that Sauce supports Appium.

Appium’s philosophy for mobile automation follows four rules:

  1. Test the same app you submit to the marketplace

  2. Write tests in any language

  3. Use a standard automation specification and API

  4. Build a large and thriving open-source community effort

We believe, just as those involved in the Appium project do, that these four principles are important in building a flexible, robust, cross-platform automation tool.

As you can see in the diagram above, the Robotium Android automation framework meets only one of these four rules.

Robotium requires developers to create a separate test application from the main application. This breaks the first rule of Appium’s philosophy, which means that when using Robotium to test Android apps, developers need to be careful that they aren’t releasing bugs or regressions that don’t occur in the test build.

Robotium Android tests cannot be written in any language or use any framework, creating limitations for developers who might want to use specific languages or frameworks to test their apps.

Another aspect to note is that Robotium tests can only be run on one device at a time. This means that you cannot run one test against a host of devices, which can make scaling testing difficult.

And, as the name suggests, Robotium is a framework that only allows you to test Android applications. While it is definitely a good tool for doing so, Sauce strives to be as platform agnostic as possible, which is why we believe that Appium is a great tool for mobile automation.

To learn more about mobile test on Sauce, check out our mobile testing page, or read our Appium tutorial.

Interested in diving in and trying Sauce Labs for Android testing?

 Sauce Labs makes automated testing awesome. Our cloud-based platform helps developers test native & hybrid mobile and web applications across 700+ browser / OS platforms, including iOS, Android & Mac OS X. Sauce supports Selenium, Appium and popular JavaScript unit testing frameworks, and integrates with all of the top programming languages, test frameworks and CI systems. With built-in video recording and screenshots of every test case, debugging tools, and secure tunneling for local or firewalled testing, Sauce makes running, debugging and scaling test suites quick and easy.

© 2023 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are registered trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.