Home » How Tos » Page 2

Category: How Tos

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.


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

How to improve your mobile testing skills

In the last couple of months I was asked by several people how I improve my mobile testing skills. The mobile world is changing quite fast and you have to keep the pace, if you want to be a good and up to date mobile tester.

I recommended to read lots of QA related blogs, read QA books, follow the right people on twitter, try new mobile testing tools at home or at work (if you have the time) to get a broader knowledge in the mobile area. Another thing I recommended was to do new things (be creative while testing), try new testing techniques or just try to break the app in a crazy way. Furthermore I recommended another way of improve the own skills. Use as many apps as possible from different categories to see how apps are developed and how they behave. Besides using them, the important thing is, check the update texts of the apps! Do not just install the latest version of the app, read before installing the app. Some app developers are really precise in what the new version of the app is all about. Which nasty bug was fixed, which new feature is developed and so on.
If there are bug fixes described, don’t install the new version, instead try to reproduce the bug and see how to get this bug to life!

Here are some examples of apps that descibed very well, what was fixed: Read more

Given When Test

Today I want to write about behavior driven development (BDD) with Cucumber and Capybara. All those things are not new, but since I changed my company I had the chance to learn new frameworks and tools. Before using the tools you need to install them :). For me the installation was kind of nasty because I am working with windows again and the installation is not so easy and comfortable as for linux or mac. The following stuff needs to be installed on your machine (windows):

If the installation is done you should install the following gems with ‘gem.bat install GEMNAME

builder, bundler, bundler-unload, capybara, capybara-screenshot, capybara-webkit, childprocess, cucumber, diff-lcs, ffi, gherkin, headless, json, mime-types, mini_portile, multi_json, nokogiri, rack, rack-test, rake, rspec, rspec-core, rspec-expectations, rspec-mocks, rubygems-bundler, rubyzip, rvm, selenium-webdriver, websocket, xpath
Read more

Mobile App Update Testing

During the development process of mobile apps manual and automated testing is highly recommended. But there is another test you should do before releasing or submitting your app to a store. Testing the update procedure! Testing the update procedure from the current store version to the new release candidate is really important and it is often not done by developers or QA experts. With this test you verify, that the new app is not affecting the old installed version. Here are three facts that will be covered with that test.

Test that the update…

  • … will not logout a user from the app e.g. before the update he was logged in.
  • … will not affect the local database e.g. existing data will not be modified or deleted.
  • … will be installed correctly from the store (simulation).

You can also test the update from far older versions to the latest one, to see what is happening.
For the two big players Android and iPhone I will describe, how to test the update from one version to another using different tools.

On the iOS side there are two ways of testing the update procedure. The first one can be done with iTunes. See also the Technical Note TN2285 from Apple.

  1. Build an adhoc app version of the app that is currently live in iTunes store. HINT: This version must have the same bundle identifier as the new app.
  2. Be sure that no older versions of the app are installed within iTunes and on your test iOS device (Sync with iTunes to be sure).
  3. Drag the app from step 1 into iTunes and sync the version to your test device.
  4. Launch the app and do some manual testing to see that the app is working.
  5. Build the new release candidate version of the app and drag it to iTunes and sync to the device. iTunes should confirm, that the older version will be removed. HINT: DO NOT delete the old build! In the next step iTunes will install the new app over the old one and will simulate the update from the app store.
  6. Launch the new version and see if everything is ok.

The second way of testing the update procedure for iOS is using the iPhone Configuration Utility. Using this tool is more comfortable, especially if you want to test the update procedure on more iOS test devices like iPhone 3G, iPhone 3GS, iPhone 4(S), iPhone 5 or iPads.

  1. Build an adhoc app version of the app that is currently live in iTunes store. HINT: This version must have the same bundle identifier as the new app.
  2. Be sure that no older versions of the app are installed on the test device.
  3. Install the app from step 1 to the devices you want to check.
  4. Launch the app and do some manual testing to see that the app is working.
  5. Build the new release candidate version of the app and install it with the tool. The update procedure will be simulated.
  6. Launch the new version and see if everything is ok.

The same can be done also on the Android side. To test the update for Android you can use adb to simulate the procedure.

  1. Install the current Google Play store version of your app to your phone.
  2. Check that the version is working.
  3. Build a release candidate of the Android app. HINT: Be sure to sign the release candidate with the Play store keystore.
  4. Use the following command to test the update procedure:
    ./adb install -r APPNAME.apk. The option -r means reinstall the app and keeping its data.
  5. The new version is now installed and can be tested.

That’s it! Try it for your next release!