Monday, November 25, 2013

What is UI Automator?

UiAutomator is a tool that comes with Android SDK (>= API 16). It is helpful to automate the UI.


Advantages over Robotium:


Robotium is a very good tools that helps in Blackbox/Whitebox testing. It can automate UI provided with the following drawbacks


  • When we are working on some application, we can not access another application. Example: Say, before you start your test, you have to turn ON wifi connection from settings page. This is not possible in Robotium. 
  • Our test apk and the application should have same signature. Suppose we want to automate a system application like "Settings", we have to sign the settings app with the same signature as our test application

These are the major drawbacks which I found with Robotium.

The major limitation in UIAutomator is, it only from Android API level 16 or higher



Overview

The Android SDK provides the following tools to support automated, functional UI testing on your application:

  •     uiautomatorviewer- A GUI tool to scan and analyze the UI components of an Android application.
  •     uiautomator - A Java library containing APIs to create customized functional UI tests, and an execution engine to automate and run the tests.

To use these tools, you must have the following versions of the Android development tools installed:


    Android SDK Tools, Revision 21 or higher

    Android SDK Platform, API 16 or higher