Robotium – test automation tool for Android applications

Robotium is a “Black Box” testing tool that is able to simulate and automate user interaction such as touching, clicking, text entry and any other action that is possible on a mobile device. The tests could either be executed on the Android simulator (AVD – Android Virtual Device) or on a mobile device. Executing such tests on mobile devices has the advantage that the application is running on real hardware within a real environment. This will help uncover potential performance problems can be identified at an early stage. With the support of Robotium, test case developers can write function, system and acceptance test scenarios, spanning multiple Android activities. Robotium is released under Apache License 2.0. Version 2.3 on April 21, 2011. It is similar to Selenium, but for Android. Robotium has full support for activities, dialogs, toasts, menus and context menus.

Robotium is built on the Java programming language and the JUnit test framework. As mentioned before, Robotium is a “Black Box” testing tool so you will not need any further information about the Android application structure or implemented classes. All you need is the name of the main class and the path that links to it. 

Application running on Android simulator 

Image-Android Simulator


  • You can develop powerful test cases, with minimal knowledge of the application under test.
  • The framework handles multiple Android activities automatically.
  • Minimal time needed to write test cases.
  • Readability of test cases is greatly improved, compared to standard instrumentation tests.
  • Test cases are more robust due to the run-time binding to GUI components.
  • Faster test case execution.
  • Robotium can run the tests on real device.
  • Open source tool and work with less resources.
  • Integrates smoothly with Maven or Ant to run tests as part of continuous integration.
  • Test cases are more robust due to the run-time binding to GUI components.
  • The framework handles multiple Android activities automatically like finds current views, follows current activities.


Robotium has few limitations, which should be understood before selecting a test application.

  • The scope of test cases in Robotium is limited to a single application and does not support for more than one application.
  • Test project is always locked with a target package, which need to be tested and going outside of the package is not allowed.
  • Android native API’s (Contacts, Widgets etc.) used in the Android application cannot be tested using Robotium. While executing test, if focus is switched to Native application, it will not come back to the Test application and Test will fail.

Robotium can not handle flash or web components; it only works with android components. You can send in clicks by using clickOnScreen() or assert that a certain activity is shown but that is all. You will not be able to write tests where you verify or work with the web or flash components.

Go through Robotium if you need more information.