The mobile test client for Android, that is, an Android device or emulator, works in conjunction with the test workbench. From an Android client you can connect to the test workbench, record and run tests, and view reports. If you are in a secure environment, you can connect an Android device to the test workbench with a USB cable. You can also use a WiFi or cellular connection.
With the mobile test 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:
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.
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:
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.
There are two ways that you can simplify this process of installing and uninstalling versions of the Android app.
After you record or play back a test, the recording or playback version of the application under test (AUT) is left on the device. If you need to restore the original AUT to your device, you can restore one AUT at a time or restore all of the AUTs at once. To restore a single AUT:
To uninstall all instrumented applications and reinstall all of the original applications under test that were on the device before you started testing:
The following message is displayed: The following operations will be performed: Clean local files
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.
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. From the same location, you can also link to several training videos about mobile testing.