Mobile Automation Using Appium + Robot Framework | Part 1

Vince Reyes
4 min readMar 22, 2021

This quick tutorial will help you to get started in mobile automation. This is intended for people who need a starting point.

Part 1 will be about setting up your workspace. Yes, it going to be tedious. But this is just a one-time effort. Once done, you will be able to proceed to the more exciting part: writing mobile automation scripts! That will be for Part 2.

There’s no skipping the following steps, so let’s get started.

Install Prerequisite Software:

*Note: this guide assumes you are using a Windows machine.

  1. Android Studio
  2. Appium
  3. Node.js
  4. Java 8 (the JDK, not just the JRE)
  5. Python 3
  6. Python Libraries

Android Studio

Link => https://developer.android.com/studio

Once the download is complete, launch the installer. Just hit next all the way through.

After the installation, you have to do the Android Studio Setup Wizard.

Appium

Link => https://github.com/appium/appium-desktop/releases/tag/v1.19.1

As of this writing, the latest version of Appium for desktop is 1.19.1. If a newer version is available, choose that one.

For easy installation, download the “exe” file.

Launch the installer and proceed until finished.

Node.js

Link => https://nodejs.org/en/download/

Nothing special here, just go through the installation steps as you normally would.

Java 8

Link => https://www.oracle.com/ph/java/technologies/javase/javase-jdk8-downloads.html

Launch the installer and follow the steps. Take note of the location where you install Java 8. You will need it later.

Python 3

Link => https://www.python.org/downloads/release/python-391/

When you launch the installer, don’t forget to check “Add Python 3.9 to PATH”

You can also choose “Customize installation” if you want to change the default location of python.

Python Libraries

Launch a command prompt as an administrator and enter this command:

pip install robotframework-appiumlibrary

Create New Environment Variables (system wide):

  1. create JAVA_HOME = use the path where you installed Java 8

2. create ANDROID_HOME = set to the android SDK path (Go to Android Studio -> SDK Manager to find the correct location)

Update Path System Variable

Add the following:

  • %ANDROID_HOME%\platform-tools
  • %ANDROID_HOME%\tools
  • %ANDROID_HOME%\build-tools
  • %JAVA_HOME%\bin

Quick Configuration Check:

  1. Run the following via command line:
npm install -g appium-doctor
appium-doctor --android

2. Review configuration checks and fix if there are errors. If you only see ‘info’ and ‘WARN’, that means your setup should work.

Create Android Emulator

You will need an android emulator too. Create a virtual device in Android Studio. Feel free to choose any device you prefer, but for the Android version, I suggest using the latest that is available.

Guide => https://developer.android.com/studio/run/managing-avds

Now your workspace setup is all good. Great progress!

For the next part, you’ll learn how to capture the elements of an Android app so that you can interact with it using Robot Framework.

PART 2 => Mobile Automation Using Appium + Robot Framework | Part 2 | by Vince Reyes | Mar, 2021 | Medium

--

--