Robotium is a mobile test framework created with an aim to write and execute automatic black-box test case for an Android application. The framework is developed for developers so that they can test an app without having any information about an app’s structure and implemented classes. The framework simplifies the testing of a mobile app as the developer just needs main class’s name and the paths which are linked to the main class.
Robotium facilitates the testing of mobile apps by enabling a test case developer to write a function, system and acceptance test scenario which can span across multiple activities of an Android operating system. Robotium is an automated testing framework for Android application, and it supports Android 1.6 and above.
The mobile test framework offers full functional support for activities, dialogs, toasts, menus and context menus along with the following benefits:
Robotium offers excellent and reliable testing results due to a host of methods provided by the mobile test framework. These methods react to the different graphical elements in a mobile app to provide near-to-reality results.
The simple methods offered by Robotium which targets the graphical elements can be implemented quickly with ease. Robotium also offers an option of combining these methods with JUnit to check values and user interaction on a mobile device for a correct response. This lends additional strength to the testing process.
To test a mobile app, a developer will have to create a test application. To complete this process, a developer needs to add the application which needs to test the version of Android by request. After this process, a tester will have to download and add robotium 2.5 library. The jar will then be added in Eclipse environment.
After the first step, a developer needs to create a Java class extending the Robotium Framework class, ActivityInstrumentationTestCase2 to start the first Robotium Test Class. The created class offers various methods and activities which interacts with the app that is being tested. The Solo Object, which is the core of an automated test, provides an access to the entire framework and all the provided methods. First of all the setup () method is initialized before using any object. Every object is initialized with the central Android activity in this method.
Once a tester creates all the test cases as per the above steps, the tester can make use of the Run as Android Junit Test command in the Run As menu in Eclipse environment to run the test case.
Using Robotium to test mobile apps is an extremely convenient and easy method for an app developer. It easily tests various functions and performers of the developed application. This saves an app developer from the embarrassment of developing and publishing a badly written app with a number of bugs.