Getting Started

Renas Reda edited this page Mar 3, 2016 · 6 revisions

Getting started

Follow the instructions below if you want to see how Robotium works and how an Android test project looks like. If you want to create a new test project then please go to the step-by-step tutorials page.

Example test project

Android Studio

In the Downloads section you will find ExampleTestProject_AndroidStudio which includes a sample Android Studio project with Robotium tests.

In the Android Studio welcome screen click “Open an existing Android Studio project”. Point to the unpacked ‘ExampleTestProject_AndroidStudio’ folder. Android Studio will open the project.

In the Project window find ‘’ in app/src/androidTest/java/ Right click and select ‘Run NotePadTest’ to run the tests on either emulator or device.


In the Downloads section you will find which includes a sample application and an example test project.

In Eclipse, import by clicking on File --> Import --> Existing Project into workspace --> Select archive file -->

Then you can run these test cases either on the emulator or on device. You right click the test project and select Run As --> Run As Android JUnit Test.

Example of a test case (test case spanning over multiple activities where EditorActivity is the first activity):

public class EditorTest extends
		ActivityInstrumentationTestCase2<EditorActivity> {

  private Solo solo;

  public EditorTest() {

  public void setUp() throws Exception {
  	solo = new Solo(getInstrumentation(), getActivity());
  public void testPreferenceIsSaved() throws Exception {
		solo.clickOnText("Edit File Extensions");
		solo.enterText(2, "robotium");
		solo.clickOnText("Edit File Extensions");

   public void tearDown() throws Exception {
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.