Robotium Remote Control Overlay Notes
2013.08.09

Definitions, Critical Reminders, Install Instructions, Test Development, What's New


Definitions:

OverlayOverwrite an existing install with upgraded assets (Libraries, Scripts, Source, etc).
SAFS Software Automation Framework Support
DeviceThe actual Android device to be used for testing.
An Emulator is also considered a device.
On-DeviceCode or applications on the device targetted for testing.
AUTApp Under Test--the on-device target APK to be tested.
MessengerThe on-device SAFS TCP Messenger APK for Android testing.
RobotiumTestRunnerThe on-device RobotiumTestRunner APK for Robotium Remote Control Android testing.
SAFSTestRunnerThe on-device SAFSTestRunner APK for SAFS Robotium Remote Control Android testing with SAFS extensions.
ControllerThe computer used to remotely control the test on the device.
For simplicity, the test development machine and the Controller are assumed to be the same.
The TestThe AUT-specific Java test code developed for execution on the remote Controller.

Definitions, Overlay Instructions, Test Development, What's New

Critical Reminders:

  1. This Overlay requires a previous installation of Robotium RemoteControl.  It is intended to overlay/overwrite key portions of RobotiumRCRelease2013.07.12.

  2. This is a cumulative Overlay.  This means it contains ALL the assets modified since the Release above--including any Overlay assets that may have been available after the Release but prior to this Overlay.  Consequently, you do not have to install multiple Overlays following the Release.  Only the latest one needs to be applied.

  3. This Overlay introduces the use of the enhanced 'safs-remotecontrol.jar' and removes the use of robotium-remotecontrol.jar.

  4. The 201307.12 Release and this Overlay are intended for use with Robotium 4.2 testing on Android API Levels 15 and above.  You should use earlier releases of Robotium RemoteControl using Robotium 3.6 to test pre-V4 versions of the Android operating system.


Definitions, Critical Reminders, Test Development, What's New

Install Instructions:

It is assumed all RobotiumRC installation requirements have been met.  If that is not the case, then you should perform a full Release install and not an Overlay.  You can apply an Overlay after installing a Release.

    NOTE:

  1. Double-click or otherwise extract the contents of the RobotiumRCOverlay ZIP into a directory.: <workdir>

  2. In a CMD/Shell/Terminal window navigate to the <workdir> directory and execute the appropriate installation script:

  3. Rebuild SAFSTCPMessenger-debug.apk:

    This step can be skipped if the Messenger was built automatically during the Overlay.

    This build is required only once with your specific developer debug profile/certificate following an Overlay.

  4. Rebuild RobotiumTestRunner-debug.apk:

    This step can be skipped if the TestRunner was built automatically during the Overlay.

    This build is required only once per AUT with your specific developer debug profile/certificate after an Overlay.

  5. Rebuild SAFSTestRunner-debug.apk (Optional):

    This step can be skipped if the TestRunner was automatically built during the Overlay.

    This build is required once per AUT with your specific developer debug profile/certificate after an Overlay.

  6. Repackage your AUT APK with your tester/developer debug profile(if needed):

    This step can be skipped if the SampleSpinner app was automatically re-signed during the Overlay.

    This step may be required for each subsequent AUT build if it was not already signed with your specific developer debug profile/certificate.

    As a reminder, re-signing the AUT can be done automatically at runtime by properly specifying the resignjar command-line parameter available to SoloTest subclasses.   Learn more about that in the section below.


Definitions, Critical Reminders, Install Instructions, What's New

Test Development:

You can use the SoloRemoteControl project installed with Robotium RemoteControl as a reference for your own Java development project.
The SoloRemoteControl/src directory contains all the sourcecode contained in the safs-remotecontrol.jar.

  1. Create your Java development project and reference the following JAR files:
    These can be found in SoloRemoteControl/libs:

  2. Create your MyTest class:
    For simplicity, this class should extend the Robotium SoloTest class.
    Or the SAFS SoloTest class.

    The SAFS SoloTest version allows the user to take advantage of the SAFSTestRunner instead of the RobotiumTestRunner.  The SAFS TestRunner provides access to SAFS Driver Commands and SAFS EngineCommands and other exposed SAFS functionality without requiring the full install and capability of the complete SAFS Automation Framework.

    The source for both of these SoloTest classes can be found in the appropriate SoloRemoteControl/src subfolders.

    You can find a copy of the example MyTest code below in the SoloRemoteControl/src folder at:

    This example uses the smaller Robotium SoloTest class and the RobotiumTestRunner instead of the enhanced SAFS SoloTest class using the SAFSTestRunner option, but the concepts are the same for both.

    Your MyTest class will need to minimally import a few classes:

  3. Override/Provide and invoke the same constructors as SoloTest:

  4. Override the static 'main' method for MyTest:

  5. Override and implement your 'test()' method:
    This is where your remote control test code will go.
    Below is a simple example of using the remote control API:

    Refer to RobotiumTestRunner support
    JavaDoc in com.jayway.android.robotium.remotecontrol.solo JavaDoc in com.jayway.android.robotium.remotecontrol

    Additional SAFSTestRunner JavaDoc support
    JavaDoc in org.safs.android.remotecontrol Also review: Using Serializable in Robotium RemoteControl

  6. Compile your work appropriate for your development environment:
    Remember, the minimum JAR files needed in the Java build path (CLASSPATH):

  7. Run the test using all appropriate command-line parameters for SoloTest:
    Remember, the same JAR files needed for the build are needed in the CLASSPATH for execution.

    For example, the following command (all on one line) for the RobotiumTestRunner:

    The equivalent command (all on one line) for the SAFSTestRunner:

    Of course, you can hardcode your arguments and paths in MyTest.java, or create a script file that performs the invocation for you.  We show the arguments here so the user can get an idea of what is involved, and arguments that might be able to be changed with the same test class. For example, the installed MyTest example is able to run the same test with either the RobotiumTestRunner, or the SAFSTestRunner specified in the runner and instrument arguments.  The same test can be run against different AVDs or devices, too.

    Hopefully, upon execution you should see a torrent of activity appear in the console and, eventually, the SAFS Messenger service go active on the device/emulator.  This would be followed by the launching of the AUT, a brief pause for the execution of the getCurrentActivity call, and then a shutdown of the AUT and SAFS Messenger service.

    If all went well, you should see your System.out text not too far from the end of the console output. The output will contain something like:


Take your test automation even further...

Robotium Remote Control has been initially coded as a subproject of the SAFSDEV Project.

SAFSDEV has integrated this into the larger and more full-featured SAFS test automation framework.  One development environment.   One JSAFS API--regardless of the application technology being tested or the tool integrations used to test it.  Thus providing extensive support for all of the technologies below within a single reusable testing framework.

SAFS Engines (Tool Integrations):


Definitions, Critical Reminders, Install Instructions, Test Development

What's New:

Since 2013.07.12: