blog

Let's talk about testing

Pioneering Appium with Ruby for Mobile Test Automation, Part 1: Required Software

This entry is part 11 of 11 in the series Test Automation

Appium is a single link in the chain called ‘mobile test automation’. Yet it has much attention focused on it. I’ve got it to work with my old Samsung Galaxy S4 phone (below). Interested?

Samsung Galaxy S5 used for mobile test automation

Firstly, what’s Appium? It’s a mobile test automation tool which appeared around 2010 and has created quite a buzz since. Appium could make manual mobile testing history but at the same time it doesn’t seem to get stable roots. In this dummy-proof series, I’ll describe my experience in setting up the testing chain from the business-readable Gherkin script using Ruby code to ultimately make test automation work on a real mobile device.

This initial post focuses on the software required for use in a Ruby-based Appium setup for Windows intended to test Android applications on a real device. This guide is aimed at people who are fairly new to mobile test automation and its challenging setup.

To be able to start test automation with Appium, all the links in the chain needs to be in place. The following pieces of software are required:

Ruby
We’re going to automate using Ruby, so you’ll need to install its software first. Make sure to pick Ruby 2.3.3, as the Ruby DevKit is not available in newer versions. The Ruby DevKit is required here because it has a feature that allows you to build native extensions later on. Put the DevKit in the Ruby directory for later use.

Don’t forget to set up your system environment variables to make sure the separate links in the chain are able to find each other. Add both the Ruby location, for example: C:Rubybin, and the DevKit location, for example: C:Rubydevkitbin, to the existing Path variable.

Java Development Kit
Next up is the Java Development Kit. Most likely the latest version will do. Once again, don’t forget to set your system environment variables. A new variable called JAVA_HOME could be created containing the location of the Java installation. For example: C:Program FilesJavajdk. Value %JAVA_HOME%bin then has to be added to the Path variable.

Android Software Development Kit
We’re building an environment capable of testing software on an Android device. To do this the Android Software Development Kit is required. The easiest way to get the kit is through installing the Android Studio. The latest version should do the trick.

Remember: eat your vegetables and set your environment variables. ANDROID_HOME should be created containing the path to your Android Software Development Kit location, for example: C:Androidsdk. To the Path variable we need to add %ANDROID_HOME%bin and %ANDROID_HOME%platform-tools so we can use Android specific features everywhere.

Apache Maven and Apache Ant
Two neat supporting tools are necessary to make this project a success: Apache Maven and Apache Ant. Download the software and put it in a convenient directory. Both directories need to be added to your Path System Environment Variable. For example: C:apachemavenbin and C:apacheantbin. For my setup I’m using the latest versions.

Node.js
We need the Java libraries bundled in Node.js too. Luckily they made an installer for this. You can simply download and install the latest software from their website.

Appium
We’ve finally arrived at the closing link in the chain: Appium. You can just download and install the software from the site. I’m running client version 1.2.0 beta 2 (containing server version 1.6.5). While this release has a lot of neat new features (like iOS 10 support) it doesn’t come with an inspector tool.

If your automation efforts require you to identify the building blocks of your application, then you need to download Appium server version 1.5 or lower. This installation can coexist alongside the latest version as long as you don’t run them at the same time. I’m currently using Appium server 1.4 for inspecting the apps on my phone.

Mobile TA Chain

That’s brings us to the end of the first part of the series. More posts about Appium development will be following soon. Stay tuned.

Required software:

Ruby 2.3.3 + Ruby DevKit
https://rubyinstaller.org/downloads/

Java Development Kit 8u144
http://www.oracle.com/technetwork/java/javase/downloads/

Android Studio 162.4069837
https://developer.android.com/studio/index.html

Apache Maven 3.5.0 and Apache Ant 1.10.1
https://www.apache.org/dyn/closer.cgi

Node.js 7.4.2
https://nodejs.org/

Appium 1.2.0
http://appium.io

Appium Server 1.4 + Inspector
https://bitbucket.org/appium/appium.app/downloads/


Reputation. Meet spriteCloud

Find out today why startups, SMBs, enterprises, brands, digital agencies, e-commerce, and mobile clients turn to spriteCloud to help improve their customer experiences. And their reputation. With complete range of QA services, we provide a full service that includes test planning, functional testing, test automation, performance testing, consultancy, mobile testing, and security testing. We even have a test lab — open to all our clients to use — with a full range of devices and platforms.

Discover how our process can boost your reputation.