How to record your Android tests with Robotium Recorder

A couple of weeks ago, I wrote a post about the release of Robotium Recorder.
Today I want to show you, how to install and how to use the tool to record your Android tests. This tutorial based on the example Notepad app provided by the Robotium project, the source code can be found here.

Prerequisites & Installation

Before you start with recording, you have to install the Java JDK and the Android SDK. Be sure you have the latest version of the Android SDK installed or updated. If your development environment is up to date, you can import the sample app, provided by the Robotium project. Please follow the instructions in the sample, on how to insert the existing project to eclipse.

If Java, the Android SDK and the sample project is downloaded and installed, start Eclipse and open the Install New Software section in the Help menu (Help → Install New Software). In the input field “Work with” enter: http://recorder.robotium.com/updates and Press the Add… button and enter a name for the installation.

1_install_robotium_via_help

Read more

How to test energy consumption on Android devices

Last week I attended the Eclipse Testing Day 2013 in Darmstadt/ Germany. The main topic of the conference was Mobile Testing. One of the best talks was “Energy testing and optimization of mobile applications” by Claas Wilke. Claas talked about the energy consumption of apps and that this topic is not considered by all developers during the development and testing phase. To prevent apps to consume to much battery, Claas developed a tool called JouleUnit. JouleUnit is an energy profiler, that can be used for Android apps, to find unnecessary battery usage of the app during runtime. JouleUnit is using the Android instrumentation framework to test the app. Beside profiling the battery usage you can also monitor the device CPU, WiFi or the display brightness. JouleUnit tests have the same structure like JUnit tests. At the end of the test run a nice graph is generated to see the battery consumption of the app.

JouleUnit Graph

Read more

Useful new Android Tool also for QA – Lint

Since the last Android ADT update 16 there is a new tool included called Lint. Lint is able to scan Android projects for potential new bugs! Here is a short list of possible problems Lint is checking: Missing translations Layout performance problems Unused resources Inconsistent array sizes Accessibility and internationalization problems Icon problems Usability problems … Read more

How to re-sign a Android apk file for testing

In the last days I got some questions about how to resign the apk file you want to test. And here is the answer. First some basic about the signatures in Android development! A signature is needed to identify the author of the Android application. A signature mostly contains information like:

  • First name
  • Last name
  • Name of the organization
  • City
  • State
  • Country Code

For more information please have a look at the Android SDK developer guide http://developer.android.com/guide/publishing/app-signing.html

Read more

How to setup a test environment for Android using Robotium

This post should show how easy it is, to setup an robotium test environment for Android Apps using the Eclipse IDE. First of all you have to download the latest Android SDK depending to your operating system from http://developer.android.com/sdk/index.html. After downloading the zip file you can unzip it to:

  • /opt for Linux system
  • /Applications for Mac OSx systems
  • c:Programs for Windows systems

AVD – Manager
Start the Android avd manager with the command ./tools/android.

Read more