Android testing overview

With the mobile test client for Android you can test native Android applications, web applications, and hybrid applications from your Android device and Android emulators.

The mobile test client for Android works in conjunction with the test workbench. From any of the clients you can connect to the test workbench, record and run tests, and view reports. From the Android client, you can also upload applications to the test workbench, where the applications are instrumented and recompiled into two new apps: a recording-ready application and a playback-ready application.

The following figure shows the native Android mobile test client:

Mobile Client

How the test workbench tests Android applications

The mobile test client for Android is a native Android application that runs on Android devices and emulators. Each Android application is packaged into a single .apk file that includes the applications code and other resource files. The .apk file is in a compressed format, similar to a zip file or a war file.

For Android, the build and compile process takes place in the test workbench on a Windows, Linux, or Macintosh computer.

Android build and compile process

Before you can test a mobile application, the application must first be instrumented. An instrumented application contains the application under test augmented with code that allows you to record or play back a test. There are two ways to instrument an Android application:

Note: The instrumentation process works differently with iOS applications.

When you record a test, the Android application (the .apk file) is recompiled into a recording-ready app that has been heavily instrumented to capture user actions. Because Android does not allow two versions of an application to be installed at the same time, the test workbench uninstalls the original application and replaces it with the recording-ready app. When you play back a test, the test workbench uninstalls the recording-ready app and replaces it with a playback-ready app, a version of the original application that has been signed with a test workbench certificate.

Note: There is also another version of the app, the Tester app. This app contains the runtime code that is needed to replay a test. This app will not be noticeable if you run in silent mode. When the application under test is modified, only the recording-ready app and the playback-ready app are generated.

You can simplify this process of installing and uninstalling versions of the Android app by choosing Playback on instrumented from the Settings page on your Android device or emulator. This lets you play back a test using the more heavily instrumented recording version of the app, rather than the lighter weight playback version of the app. This is at the expense, however, of slower playback speed and greater memory consumption.

Passive mode

When you are ready to run your tests, you can run them on the device or in the test workbench. To give control to the test workbench, simply tap Enter Passive Mode from the mobile test client.

Getting help

You can get help about mobile testing directly from your mobile device or the Android emulator by tapping the Help menu item or Help button. The actual location of the menu item or button varies from one device to another and also varies according to the version of Android that is installed. The picture below is from a Nexus 7 tablet running Android 4.3, where the Help menu item is located in a drop down menu in the upper right corner of the device.

Getting help


Feedback