Skip to content

Instantly share code, notes, and snippets.

@davidmigloz
Created January 28, 2016 13:18
Show Gist options
  • Save davidmigloz/fc865c39db9da14f28d1 to your computer and use it in GitHub Desktop.
Save davidmigloz/fc865c39db9da14f28d1 to your computer and use it in GitHub Desktop.
Most important methods of Robotium Solo API.
  • solo.unlockScreen(): Unlock the screen if it is locked.
  • getView(int id): Searches for the view with the specified ID in the current activity.
  • clickOnView(): Click on a view.
  • assertCurrentActivity(text, Activity.class): Ensure that the current activity equals the second parameter.
  • enterText(): Enters a text.
  • clickInRecyclerView(): Click on an item of a recycler view and return it.
  • clickOnImageButton(): Click on an image button by index.
  • clickOnScreen(): Click on a certain point of the screen located by given coordenates.
  • getCurrentActivity(): Get current activity.
  • waitForText(text): Waits for a text on the screen, default timeout 5 seconds.
  • clickOnButton(text): Clicks on a button with the "text" text.
  • sendKey(Solo.MENU): Sends the menu key event.
  • clickOnText(text): Search for text in the current user interface and clicks on it.
  • waitForCondition(): Wait for a condition to be satisfied.
  • searchText(text): Searches for a text in the current user interface, return true if found.
  • searchButton(text): Searches for a button with the text in the current user interface.
  • clickOnSearch(): Allows to click on part of the screen.
  • goBack(): Press the back button.
  • setDatePicker(): Sets the date in a DatePicker.
  • clickInList(x): Click on item number x in a ListView
  • pressSpinnerItem(0,2): Presses an item in a Spinner
  • isCheckBoxChecked(): Checks if the checkbox is checked.
  • takeScreenshot(): Saves a screenshot on the device in the /sdcard/Robotium-Screenshots/ folder. Requires the android.permission.WRITE_EXTERNAL_STORAGE permission in the AndroidManifest.xml of the application under test.
  • waitForActivity(SecondActivity.class, 2000): Waits for the specified activity for 2 seconds

Solo API JavaDoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment