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:
Add the
Robotium
JAR to your Build Path.Create a test case using the JUnit
TestCase
class.Write the test case code.
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:...