March 29, 2016

581 Views

Testing of Android Based Applications Using Robotium

In the era of smart phones and mobile computing, the smart phone is a hot topic in the market of latest technology trend and swiftly rising day by day. This has become possible because of the ease of accessibility of phone with the help of wider range of Android based applications.

As of now, an approximate 3.97 million applications are available on all leading app stores like Google and Apple, and the count of new applications are increasing day by day.

The scope of automation testing in market of android app testing is extensively increasing to test the front-end of Android based mobile applications. Although the mobile application front-end could be tested manually, but it seems complicated because of the following:

  1. Manual testing could be done only on the actual device.
  2. More effort is needed to run the test suite.
  3. Dedicated resources /testers are needed to test on a particular type of Android device.

The following diagram describes the high level flow for manual testing of Android applications:

Fig. 1: High level flow diagram for Manual Testing of Android Applications

In the huge store /collection of open source software Robotium is available for android testing, before going in detail first we have to think on a question what is robotium and how it helps in android testing?

The answer to the question is, Robotium is an open source and simple test framework available to test the front-end of Android based applications directly on actual Android device or on the emulator.

The Robotium test framework can be configured on Eclipse IDE, which executes the automated Android test scripts on actual device connected through Android debugger (i.e. adb) or on the emulator. The creation of test script is very simple and it works based on the UI actions like:

  • Click on Button
  • Click on Text
  • Search Text
  • Go Back
  • Enter /Input text etc.

The way of writing the test scripts is very similar to writing the < href="http://www.hcltech.com/blogs/mock-testing-using-junit-and-soapui">test scripts in JUnit for other applications, only the changes of Robotium SDK has to be incorporated, in order to connect the device/emulator and the objects of Android application under test.

The following diagram describes the high level flow for automated testing of Android applications using Robotium:

Fig. 2: High level flow diagram for Automated Testing of Android Applications

Using Robotium, the following benefits could be achieved:

  1. Testing can be done on an emulator or on the actual device.
  2. Due to automation, visible testing effort could be saved.
  3. Less number of testing resources is needed.

References

http://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/