text: Robot. its own decisions (ex: When to scroll, etc.)
  No modification to Android platform.
  Test execution is fast.
  Test cases are more robust due to the run-time binding to GUI components.
  Integrates smoothly with Maven or Ant..
  Step 1 − The prerequisites to use Robotium is Java SDK (minimum 1.6). If you don’t have Java installed on your system, then follow the steps given below.
  Download JDK and JRE from Oracle Technology Network
  Accept license agreement.
  Install JDK and JRE.
  Set environment variable as shown in the screenshot below.
  Step 2 − Download Android Studio from Android Studio
  Step 3 − Install Android images and tools.
  Select the necessary package. For example, if we are building an App for Android 4.4.2, then make sure the following packages are checked under the Tools section −
  Step 4 − Create Android Virtual Devices.
  Use the following settings for a Nexus5 AVD −
  You should now see the AVD you created in the AVD Manager, where you can start it, delete it, or create another one!
  Step 5 − Robotium Jar file Download Robotium Jar file from RobotiumTech
  To test an App with Robotium, follow the steps given below −
  Step 1 − Create a test Project in the Android Studio named as “RobotiumTest”.
  Choose all the default options until you reach to the main page.
  Step 2 − Copy the Robotium jar file into the Lib folder of the project.
  Step 3 − Add the dependency in build.gradle file under src folder.
  androidTestCompile 'com.jayway.android.robotium:robotium-solo-5.5.3'
  Step 4 − Sync the Gradle.
  Step 5 − Create the Test class as follows −
  package com.example; import com.robotium.solo.Solo; import android.test.ActivityInstrumentationTestCase2; import android.widget.EditText; import android.widget.TextView; public class MyTestClass extends ActivityInstrumentationTestCase2<TestActivity>{ private Solo solo; public MyTestClass() { super(TestActivity.class); } public void setUp() throws Exception { solo = new Solo(getInstrumentation(), getActivity()); } public void testCase() throws Exception { String vResult="TestExample"; EditText vEditText = (EditText) solo.getView(R.id.edit1); solo.clearEditText(vEditText); solo.enterText(vEditText,"TestExample"); solo.clickOnButton("Submit"); assertTrue(solo.searchText(vResult)); TextView textField = (TextView) solo.getView(R.id.txt1); //Assert to verify result with visible value assertEquals(vResult, textField.getText().toString()); } @Override public void tearDown() throws Exception { solo.finishOpenedActivities(); } }
  Step 6 − Save all changes. Make sure no errors are present.
  Step 7 − Now, run the test case. If the test case is successful, you should see the following output!