Android Inter-app UI testing with UIAutomator

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


  • Instrumentation getInstrumentation()
  • UIDevice UiDevice.getInstance(Instrumentation instrumentation)
  • boolean UIDevice.pressHome()
  • boolean UIDevice.pressBack()
  • boolean UIDevice.pressRecentApps()
  • void UIDevice.wakeUp()
  • boolean UIDevice.swipe(int startX, int startY, int endX, int endY, int steps)
  • boolean UIDevice.drag(int startX, int startY, int endX, int endY, int steps)
  • UIObject2 UIDevice.findObject(By.desc(String contentDesc))
  • boolean


UIAutomator are especially good for testing user stories. You run into problems if view elements have neither a unique resource-id nor content-desc. In most of the cases there is a way to complete the test anyways, what that takes a lot of time. If you can influence the code of your app, UIAutomator may be your testing tool.

Got any Android Question?