Robotium is an Android test automation framework that has full support for native and hybrid applications. Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities.
Robotium is a test framework that allows to implement white-box test cases for native Android applications. It supports black-box testing too (i.e. without source code and only when the apk file is available) as long as the apk file and the test project are signed with the same certificate signature.
To achieve this it might be required to resign the apk file. Consequently pre-installed applications can be tested on rooted phones as well.
The Robotium main class, Solo
, provides methods to click or tap on a number of views identified by id, index or containing text strings, e.g.:
Solo solo = new Solo(getInstrumentation(), getActivity());
solo.clickOnText("Release rabit"); // Click on some text
solo.clickOnButton("Ok"); // Click on confirmation button
It also allows to assert that some message is currently displayed by GUI:
// Assert message is displayed
assertTrue(solo.searchText("Rabit is on the field"));
It also provides methods to send key events, capture screen shots, wait for the named activity to appear and others.