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:
Test the same app you submit to the marketplace
Write tests in any language
Use a standard automation specification and API
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.