Mobile test automation in 3 simple steps

Mobile Test Automation made simple with Cucumber


Hi Again,

In this post we would like to explain a bit more about the mobile test automation that we are using here at spriteCloud. The past years we have seen that the mix of cucumber with selenium webdriver has been extremely powerful. This setup allows for test automation that is, besides easy to setup and maintain once you get the hang of it, understandable and easy to expand for any stakeholder in your project. We are using this same setup now for testing native mobile applications and it works like a charm!

We will start with mobile test automation for android. For this test automation we are using calabash-android which is basically a mix of cucumber with robotium under the hood…

Step 1 – Setup your environment

First, you need to get all your libraries sorted. This should be fairly easy to achieve since you just need to;
– Install ruby if you dont have it installed already
– install calabash-android:

gem install calabash-android

Depending on your testscenarios you might need some more libraries but you’ll get there along the way.

Now, make a root folder where you want to store your test automation files and create the skeleton files for your test automation by running the following command:

calabash-android gen

This step is also well explained at the installation section of the calabash-android project

Step 2 – Use the default debug build key and signature

Well done, you’ve got all the requirements to build your test automation suite. Well, you’d need an app as well. Plus you’d need to sign it and use the exact same key and credentials for your calabash testserver, else it wont be able to install and run it on the emulator or device. Although creating a key and use it to sign your apk is all explained on the android developers pages, the easiest would be to just have the test automation use the default debug key that android uses (which is being generated when you build your application). The only thing you need todo for that is to create/edit a .calabash_settings file in the root directory of your test automation folder and point to that keystore file. For example:


NOTE: api_level obviously depends on what android platform you are building your app on so make sure to have that set correctly.

Step 3 – Test the test setup

There you go. Now your test setup should be all set. You dont have any test scenarios yet, but running calabash should show you if you have everything set up properly!

calabash-android run 

In the features folder you can place your scenarios. Information about creating feature files can be found in our blog about cucumber and web testing.

For iOS you say?…

Yes, there is a gem called calabash-ios. This is working somewhat different since there is no robotium under the hood. Its too much work to cover that here, so hopefully we are able to give some more information for you at a later stage.

‘Happy test-automationing’!

Suggested Posts

Written by: Mark Barzilay

Graduated with honors from TU Delft in 2007 studying Electrical Engineering and Media & Knowledge Engineering. Founded spriteCloud in 2009 and worked on test automation ever since, helping out small and large companies with their test automation strategy and infrastructure. Mark is also leading the development on, an online platform for all your automated test results.

Subscribe to our mailing list!

Stay up-to-date on all things quality assurance,
test automation, and cybersecurity.

We’re spriteCloud, a leader in software and cybersecurity testing.

Aside from interesting articles, we also have a team of software testers that can help your organisation.

Have a look at our testing solutions.