Adding Android apps to the test workbench from the command line

You can automate the process of adding Android apps to the test workbench with the AddAndroidApp.jar command line tool, which you can download from the Android Welcome Page. This tool instruments the application under test and then adds it to the test workbench.

Procedure

  1. Start test workbench.
  2. In the test workbench, click the Display Workbench URL icon Workbench URL and copy the Workbench URL to the clipboard using the link provided.
  3. Paste the link into your web browser.
  4. When the Rational® Test Workbench Mobile Welcome Page opens, click Proceed with Android instructions.
  5. Under Use a command-line tool to add Android applications that you want to test to the workbench, click Show the steps.
  6. Verify that you have release 6 or later of a JDK or JRE installed on your computer. Then, click Click here to download to download AddAndroidApp.jar. Save the download to a local folder.
  7. Change to the local folder where you downloaded the jar file.
  8. Run AddAndroidApp.jar as follows to learn about mandatory and optional parameters for the file.
    java -jar AddAndroidApp.jar
    Note: The AddAndroidApp.jar file returns an exit code of 0 when it runs successfully.
  9. Run AddAndroidApp.jar as follows to instrument an AUT, such as Calculator.apk and add it the test workbench.
    java -jar AddAndroidApp.jar -w http://192.0.2.24:7878 C:\MyAndroidApps\Calculator.apk

    Running AddAndroidApp.jar results in three new .apk files:

    • I-original apk name.apk - Recording-ready application
    • R-original apk name.apk - Playback-ready application
    • T-original apk name.apk - Test engine for the application

    See How the test workbench tests Android applications for details about the .apk files and the Android build chain. See AddAndroidApp.jar script for additional examples and command line arguments.

  10. To automatically update tests of a previous version of the AUT to use the latest version of the AUT, click Window > Preferences > Test > Mobile and Web UI > General Settings and select Always for Test Suite Refactoring when adding application.

Feedback