Book Image

Testing and securing android studio applications

Book Image

Testing and securing android studio applications

Overview of this book

Table of Contents (18 chapters)
Testing and Securing Android Studio Applications
About the Authors
About the Reviewers

Tools for functional testing

In Chapter 9, Unit and Functional Tests, you learned how functional tests are performed with full connection to the system infrastructure. In this section, we will look at the different tools that allow us to easily perform functional tests in Android applications:

  • Robotium

  • Espresso

  • Appium

  • Calabash

  • MonkeyTalk

  • Bot-bot

  • Monkey

  • Wireshark


Robotium runs on the official Android testing framework. It adds the necessary features to run through an entire Android application. It has full support for both native and hybrid applications.

Now, we will see the steps needed to run a test using Robotium on our Android application:

  1. Add the Robotium JAR to your Build Path.

  2. Create a test case using the JUnit TestCase class.

  3. Write the test case code.

  4. Run the test case.

Tests with Robotium are performed using the com.robotium.solo.Solo class available in the Robotium library.

We will now see an example of the white-box testing using Robotium. In this example, we have two EditText fields:...