Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Appium-Mobile App Automation (Configuration and Installation), Part 1

DZone's Guide to

Appium-Mobile App Automation (Configuration and Installation), Part 1

In tutorial, we'll walk you through using Appium to run tests on your Android app from installation all the way to the automation test case.

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Part One

Appium is an open source test automation framework which is used for testing hybrid apps, native apps, and mobile web apps for Android and iOS using webdriver.

Appium works on a distributed open source mobile UI testing framework. It runs the automation test on real devices, emulators, and simulators. Appium translates the selenium web-driver command into UIautomation, like Android device. Appium supports lots of languages like Java, PHP, Ruby, Python, JavaScript, Node.js, etc.

How to Use Appium:

To use Appium, we need the following items:

  1. Android sdk

  2. java

  3. TestNg

  4. Appium for Ubuntu

  5. Selenium jar

  6. Apk app

So, we start from Android sdk. First of all, download the Android sdk. After downloading the sdk, run the following command in your terminal.

$android

This will download all the Android's API. Whatever you used after that we enter into the emulator open command. It will open the emulator.

android-avd

emulatorstart

Next, we start the emulator, which works on Android API 5.0.1.

android-emulaoropen

After that, we will install the Appium on Ubuntu machine.

> brew install node      # get node.js
> npm install -g appium  # get appium
> npm install wd         # get appium client
> appium &               # start appium
> node your-appium-test.js

After installation, we start the Appium server.

appium

We can see our connected device listed in Command Prompt type 'adb devices' on our terminal.

adbdevice

Appium does not support versions of Android lower than 4.2. So if you want to test the lower version of Android you can use Selendroid.

Part Two

In the first section of this article, we described the Installation and configuration of Appium on an Ubuntu machine. Now we will explain how to run automation test cases on Android devices using Appium.

So, for test the app we have to put the app apk in an Android device which we want to test. After that, we start writing the code using selenium webdriver. We are using a TestNg framework with selenium webdriver.

So when we run the program, the Appium server automatically starts the mapping with the emulator and running the script on the emulator.

appiumcode

appium-server-start

Here is the result of automation test case.

report

Feel free to ask me any question.

Thanks.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:
appium ,mobile ,app development ,app testing

Published at DZone with permission of manoj mathpal, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}