Introduction to Appium and Its Architecture & Configuration

Appium is mobile web, native and hybrid software application test automation tool.

  • It is open-source software automation tool, which is useful to automate android and IOS platform apps.
  • Most important thing is : Appium is “cross-platform” automation tool so you can write software automation tests against iOS and Android (multiple platforms) using same API.
  • “cross-platform” enables you large amount of code reuse between iOS and Android test suites.
  • Appium support software test automation on emulator or simulator and physical mobile devices too.
  • Appium is developed on few key philosophy points :
  1. Should not have to recompile your app to automate it.
  2. Should not be locked into a specific language or framework.
  3. Should be open source and
  4. Should not reinvent the wheel when it comes to automation APIs.

Limitations of Appium

There are few limitations in appium right now.

For Android, No Support for Android API level < 17.
Script execution is very slow on IOS platform.
Gestures support is limited.
No support for Toast messages.

Appium’s Architecture

Appium is an HTTP server written in node.js, which creates and handles multiple WebDriver sessions for different platforms like iOS and Android.

Appium starts a “test case” on the device that spawns a server and listens for proxied commands from the main Appium server. It is almost same as Selenium server, which perceives http requests from selenium client libraries, and it handles those requests in different ways depending upon the platforms. Each vendor like iOS and Android have a different way and mechanism to run a test case on the device so Appium kind of hacks in to it and run this test case after listening commands from appium server.

Configuration of Appium:

Please refer attached document for software installations required and steps to install appium.

Connect Android Device with PC In USB Debugging Mode To Run Appium Test

You need to connect real android device with PC in USB debugging mode in order to run android app automation tests in real android device using appium

Enable Developer Option In Android Device

Previously if you have not enabled “developer options” in your android device then once you need to enable it in order to switch device in USB debugging mode. Otherwise, you can not access USB debugging mode in your device.

Verify Developer Option Is Enabled?

To check Developer Option is enabled or not,

Go to Settings.
Check if there is any option like “Developer Option”?
If Developer Option is enabled then it will display there. Otherwise follow the steps given bellow to enable it.

Enable Developer Option

To enable Developer Option in android device,

Go to Settings.
Scroll down to bottom and tap on About Phone.
Scroll down bottom again on About Phone screen. You will see option Build number.
Tap seven times on Build numberoption one by one. After 3 tap, It will start showing you message like… “You are now 2 steps away from being a developer” as shown in bellow image.
After 7 times Build numberoption tap, It will show you message “You are now a developer!” as shown in bellow image.
Now go back to Settingsand scroll down bottom.
You will see option Developer Optionsabove About Phone as shown in bellow image.
Connect Device with PC and Start USB Debugging Mode

Note: Let me warn you before enabling USB debugging mode in your android device. Enable USB debugging only when you need it. Leaving it enabled all the time is kind of a security risk as it allows high-level access to your android device. So disable it immediately when you have not any usage of it.

To start USB Debugging mode,

Connect your device with PC using USB cable.
Go to Settings -> Developer options.
There will be option USB debuggingwith check box. Check it.
It will ask you to “Allow USB debugging?”. Tap on OK.
It will enable USB debugging mode for your android device.

Verify Device Connected Properly With PC

To verify device is connected properly with PC with USB debugging mode,

Open command prompt in your PC.
Run command ADB devices.
It will show you list of connected devices with your PC. If not display, any device in list that means there is some issue with device connection or USB debugging mode is not enabled properly.

How to Locate Element using UIAutomatorViewer

“UIautomatorviewer" is a GUI tool to scan and analyze the UI components of an android application. With “UIautomatorviewer”, you can inspect the UI of an android application in order to find out the hierarchy and view different properties (id, text…) of the element.

“Uiautomatorviewer” is a part of the Android SDK manager and will be accessible once you install the sdk manager. Download and install Android SDK manger from

Once Android SDK installed, navigate to link c:\users\AppData\Local\Android\sdk\tools you’ll notice a batch file with name ‘uiautomatorviewer.bat’. Double click on it to launch “Uiautomatorviewer” GUI

Source: Confengine