Appium: A Short Guide to Get Started

DZone 's Guide to

Appium: A Short Guide to Get Started

If you've ever used Selenium for testing websites, you'll be able to get into Appium in no time.

· Mobile Zone ·
Free Resource

I recently amended the Selenium WebDriver API with Java online training to include a section on Appium with Android.

In essence, Appium for mobile web testing is pretty simple, you simply use RemoteWebDriver to connect to the Appium server.

Use the capabilities to set up the remote webdriver.

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability("deviceName", "emulator-5554");
capabilities.setCapability("platformName", Platform.ANDROID);
// if you are using an up to date version of android to you can use "Chrome" as the app,
// otherwise "browser" is the default 'browser' on Android
capabilities.setCapability("app", "browser");

String appiumURL = "";
driver = new RemoteWebDriver(
        new URL(appiumURL),

// and then use driver as normal

To get started with Appium:

If you are working with modern physical device connected via USB then you can probably use "Chrome" as your "app" and then drive the Mobile Chrome browser (which handles frames better than the default ‘browser’).

If you are working with the Android VM and an AVD then you’ll probably have to use Level 23 of the API, which will come with ‘browser’ rather than ‘chrome’.

Android N (api level 24) comes with Chrome in the AVD but you’ll have to amend Appium slightly to work with it (I chose not to do that and used level 23 with the AVD, and used Chrome on the physical devices).

We cover all of this in more detail on the course, but each of the sites linked to above has install and getting started instructions.

And if you get everything setup, just connect as a RemoteWebDriver as shown in the code snippet above.

You might have to amend the @Test code a little to introduce different synchronization, but I was surprised at how compatible it was.

Appium has come a long way in a short time, has overcome enormous challenges and deserves to be the default mobile bridge for Selenium WebDriver.

android ,appium ,mobile ,webdriver

Published at DZone with permission of Alan Richardson , 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 }}