Appium & Appium Inspector

Emre Öztürk
Ebebek Tech
Published in
5 min readNov 22, 2022

Mobile App Automation

Getting Started

Appium supports iOS as well as Android apps. To install appium and get started with using it there are some steps which you need to follow to set it up on different OS versions like Windows and macOS.

Introduction

Mobile applications are more popular than web applications nowadays because of the mobility provided by the smart phone manufacturers. Today, most of the things a laptop can do, can also be done using a smart phone too. So that, learning mobile application automation will be vital to Quality Engineers.

What is Appium?

Appium is an open source ecosystem of tools and libraries that help you drive your mobile apps (native, hybrid, and mobile web on platforms such as Android, iOS), desktop apps (Windows, Mac), and now even on platforms like Smart TV and much more .

Appium Core Philosophy

Language agnostic: With Appium you can choose the language binding of your choice (Such as Java, Kotlin, Python, JavaScript, Ruby, C# … 🆓) and don’t have to be tied to the programming language of the platform vendors (Kotlin, Swift, etc.).

Does not reinvent the wheel: Appium provides a convenient API compliant with Web driver protocol that wraps automation libraries from vendors (Google UIAutomator2/Espresso, Apple XCUITest/UIAutomation, Windows WinApp) and allows you to write cross-platform tests.

No requirement of SDK or recompilation of the app: Appium can drive the app from a grey box user perspective but does not need any app compilation step.

Cross-platform: Drives apps on different platforms and provided apps have the same business logic, could drive them with a single cross-platform test.

Core Concepts

Before diving into practical setup and tests, it’s important to understand the Appium ecosystem in a birds-eye so that you can make sense of all the different components at play

The core components are:

  • Client-server architecture
  • Session
  • Desired capabilities
  • Appium Server
  • Appium Clients
  • Appium Desktop

Client-Server Architecture

Appium Server

  • Appium is a NodeJS-based web server that exposes REST APIs and bridges commands to native frameworks from vendors (Google, Apple)

Appium Clients

  • Appium provides client bindings in different languages that adhere to WebDriver protocol and exposes actions and behaviours for automation
  • Test code makes use of these clients to perform desired actions on devices

E2E Request Flow

A typical request in Appium loosely looks like below:

  • The server receives a connection request from the client
  • The server listens for commands
  • The client makes a request to server
  • Server talks to different platform drivers
  • Drivers talk to native frameworks and finally the common gets executed on the target device (mobile, desktop, TV, etc)
  • The server returns an HTTP response

Session

  • Each action in Appium happens under the context of a session
  • We generally start a session with a Desired capabilities object to specify the exact type of connection we want and what behaviours are we most interested in.

Desired Capabilities

  • Think of this as a Hashmap with the key being a unique capability/behaviour that you want the driver to expose and values with the configurations.
  • For example, you may want to set up the device in landscape or portrait mode for a test case, you can then use either of the below configurations

What is Appium Inspector?

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server. When you’re using it to inspect a mobile app.

Appium Inspector is basically just an Appium client (like WebdriverIO, Appium’s Java client, Appium’s Python client, etc…) with a user interface. There’s an interface for specifying which Appium server to use, which capabilities to set, and then interacting with elements and other Appium commands once you’ve started a session.

How To Use Appium on EBEBEK

Testing is the most relevant phase in SDLC. Ebebek company Testing is the quality assurance stage and done to point out the errors and bugs came during development so that it gives satisfaction and reliability to the customer over application. Tester envisions business situation by their Critical thinking and rational approach. To ease the work of a tester the automated tools can execute, report and compare the result with previous test runs.

Step 1 — Open Appium Server

Step 2 — Open Appium Inspector

Appium server information, Simulator device information and application information are defined.

Step 3 — Finding components in appium inspector and simulator

The necessary components are found by the simulator and the ınspector. Addresses are taken as id or xpath and defined to the necessary pages to be run in page steps.

Step 4 — Simulator Connection Information is Given

Test scenarios prepared in bdd format send requests to appium respectively. Appium runs the incoming data on the simulator and returns the test result as pas or fail.

Pass Test Example

Fail Test Example

--

--