The automation process includes the following procedures:
You can instrument the AUT and add it to the test workbench
by uploading the app from a mobile device or emulator or by clicking the Add applications
to list icon
in the test workbench. To automate the process, use
AddAndroidPackage.jar, which you can download from the Android Welcome Page.
See Adding Android apps to the test workbench from the command line for details.
Running AddAndroidApp.jar results in three new .apk files:
See How the test workbench tests Android applications for details about the .apk files and the Android build chain.
adb install -r localdir/R-AUT-name.apk
adb install -r localdir/T-AUT-name.apk
adb install -s emulator-5556 -r localdir/T-AUT-name.apk
adb install -s emulator-5556 -r localdir/R-AUT-name.apk
adb install -s emulator-5558 -r localdir/T-AUT-name.apk
adb install -s emulator-5558 -r localdir/R-AUT-name.apk
For details, see Directing
commands to a specific emulator or device. adb uninstall com.ibm.rational.test.mobile.android.client.ui
adb install "Eclipse client path/com.ibm.rational.test.mobile.android.client.ui-release.apk"
adb shell am start -n com.ibm.rational.test.mobile.android.client.ui/.MainActivity -e workbench_url "Workbench-Url" --ez passive_mode “true”
For example:
adb uninstall com.ibm.rational.test.mobile.android.client.ui
adb install "C:\Program Files\IBM\IBMIMShared\com.ibm.rational.test.mobile.android.client.ui-release.apk"
adb shell am start -n com.ibm.rational.test.mobile.android.client.ui/.MainActivity -e workbench_url "9.44.55.666:7878" --ez passive_mode “true”
If you want to automate tests of mobile web applications, you must ensure that the Mobile Web Recorder is installed on the mobile test client. If the mobile test client is set up to run silent mode with the USB Controller, the Mobile Web Recorder will be installed automatically when the test run starts. No user action is required. However, if silent install is not set up, you must install the Mobile Web Recorder by tapping Manage Web Applications once in the mobile test client. This will initiate the installation of the two required apks and fulfill the requirements for automated test playback of a web app.
If your automated testing requires the test workbench to be stopped and re-started, you can enable the Do not quit when workbench exits setting in the USB Controller to keep the USB Controller running even after the test workbench is closed. For details, see USB Controller.
By default, the test workbench selects the first connected device that best fits the test execution requirements (Android OS and Android API). To run the test on one or more specific devices, define the Device ID selection variable. To find the Device ID, open the Mobile Devices editor in the test workbench, select a device, and look for the ID in Detailed Properties.
You can also use a variable to select a specific device. For details, see Defining a variable to run a test with a selected mobile device.
All test scripts are linked to a specific version of the AUT. If you upload a new version of the AUT, you should always run the test on the newest version of the AUT. For details, see Defining a variable in a test to run the latest version of an application.