Tuesday, March 15, 2011

Android Automation Testing Tools

Mainly two open source tools are used for Android automation testing.

1.MonkeyRunner
2.Robotium

MonkeyRunner.

For writing programs the Monkeyrunner tool provides API and it control Android Device or any other emulator from outside of the Android script.Python program writes in Monkeyrunner and install Android applications or tes packages and that can run to it.It takes screen shots of its User interface and it store screenshot on the workstation.This tool can used for testing functionl applications and it used for unit testing.

The Monkeyrunner tool provide,

* Multiple device control: The monkeyrunner API can apply one or more test suites across multiple devices or emulators. You can physically attach all the devices or start up all the emulators (or both) at once, connect to each one in turn programmatically, and then run one or more tests. You can also start up an emulator configuration programmatically, run one or more tests, and then shut down the emulator.
* Functional testing: monkeyrunner can run an automated start-to-finish test of an Android application. You provide input values with keystrokes or touch events, and view the results as screenshots.
* Regression testing - monkeyrunner can test application stability by running an application and comparing its output screenshots to a set of screenshots that are known to be correct.
* Extensible automation - Since monkeyrunner is an API toolkit, you can develop an entire system of Python-based modules and programs for controlling Android devices. Besides using the monkeyrunner API itself, you can use the standard Python os and subprocess modules to call Android tools such as Android Debug Bridge.

You can also add your own classes to the monkeyrunner API. This is described in more detail in the section Extending monkeyrunner with plugins.

The monkeyrunner tool uses Jython, a implementation of Python that uses the Java programming language. Jython allows the monkeyrunner API to interact easily with the Android framework. With Jython you can use Python syntax to access the constants, classes, and methods of the API.

Robotium

Robotium is a test framework created to make it easy to write powerful and robust automatic black-box test cases for Android applications. With the support of Robotium, test case developers can write function, system and acceptance test scenarios, spanning multiple Android activities.

Robotium has full support for Activities, Dialogs, Toasts, Menus and Context Menus.

Robotium provides the following benefits:

* 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 solid 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.
* Blazing fast test case execution.
* Integrates smoothly with Maven or Ant to run tests as part of continuous integration.

2 comments:

Stephan said...

So? What are main differences? What do use those two tools for?

Testing World said...

Robotium support Java only. It's like JUnit.Monkey runner support Python scripts and so that you can write Python scripts to run test suites.Monkey runner is provided by android.

These tools are used for Android mobile application testing.