Yesterday Daniel Knott announced that he has published his book Hands-On Mobile App Testing.
Daniel writes on his book page: “This book is aimed at anyone interested in mobile apps and mobile testing, ranging from junior to expert mobile testers who are already involved in mobile development teams. This book is also ideal for software test managers who need to manage mobile testing teams or to select a mobile test strategy. It’s also great for software testers who are new to this topic and want to switch to mobile technologies.”
I was able to give early feedback and I can recommend the book to all mobile testers!
In this blog post I would like to write again about mobile test automation.
In the last months I spent a lot of my time working on a new test automation framework: Selendroid - a mobile WebDriver implementation for native and hybrid Android apps.
Yesterday and today I attended the Google Developer Group (GDG) DevFest in Zürich and I really enjoyed it! I have seen good presentations, met really nice people and I had great discussions.
This afternoon I did a presentation about how to automate native Android apps using Calabash-Driver and how to leverage an existing Selenium Grid2 architecture to allow scaling and parallel testing.
Here you find my slides of today’s presentation:
For the GDG DevFest presentation I used the Greenhouse application to showcase about how to write an automated Android end-to-end test. Please keep in mind that this showcase was created mainly to demonstrate, how Android app automation looks like in practice. This means the super class of the test case is starting the Calabash-Driver Server automatically. In a scenario where the Selenium Grid would be used, this component is typically started per shell script.
The actual code of the showcase is located at Github. To get started please follow the steps described in the Greenhouse application blog post. For executing the scripted test you need first to install both apk files, that are located in the github project in the download section. After starting the emulator, the test can be executed by executing the TestNG test.
[Update 1. November 2012]
The full talk was recorded and is now available on YouTube.
My colleague Tim Messerschmidt ( Developer evangelist at PayPal) attended the DevFest as well and introduced PayPal Access. If you are interested in this topic, I recommend to checkout his blog post.
For writing good automated mobile end-to-end tests I personally prefer to use e.g. the IDs of the elements. For doing this, you can have a look at the application’s source code and analyze the corresponding layout.xml file.
But sometimes, if e.g. on the screen are dynamic lists like search results displayed, it is quite helpful to inspect the dialog on the mobile device that is currently displayed.
The Android platform has a tool called hierarchy viewer - which is working quite well. The full UI element tree is displayed and the properties of each element can be displayed. The drawback of this tool is, that is quite slow and on some machines with less than 4GB RAM it is unusable.
For Calabash-Android I implemented a command that inspects the current dialog and returns about each UI view component the corresponding class name, the Android ID (name, defined in the layout.xml file) and for some elements the text:
In combination using the interactive Ruby shell, which I have described in my last blog post , this is quite powerful and is speeding up the test development a lot. The command for the shell is: