Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Mobile integration

Mikołaj Mański edited this page Jul 12, 2016 · 3 revisions

Mobile support

Android

You can use Appium tool alongside Bobcat to run your tests on Android mobile devices (real and emulated).

Scope

Appium supports selenium-compatible mobile browser automation. It allows us to navigate through objects, follow links, fill in forms etc. Mobile browser automation does not support touch gestures. Currently it can be done only for native Android applications. If you want to automate native android applications using touch gestures see this test from appium java-client: https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/android/AndroidGestureTest.java

Configuration

Install and configure Android SDK:

  1. download standalone Android SDK from http://developer.android.com/sdk/index.html
  2. install to a custom location, i.e. C:\android-sdk. You need to choose a folder that does not contain any spaces (like C:\Program Files...). This could result in "Logcat capture failed: spawn ENOENT" or similar error.
  3. configure ANDROID_HOME environment variable to point to SDK location.
  4. add %ANDROID_HOME%\platform-tools to your system path

Install appium:

  1. download appium from http://appium.io/
  2. unzip appium to a folder, say c:\appium
  3. start console and navigate to appium folder.
  4. run command: "npm install appium"
  5. start appium server: "appium start"
  6. appium GUI should appear. Click the launch icon in the top-right to start the server.

Install and configure android device:

  1. install latest device drivers, for example Samsung's driver for tablets and phones if you are using a samsung device
  2. enable USB debugging in device properties
  3. connect the device via USB
  4. make sure that the device is visible in android devices list. Run "adb devices" to view the list.
  5. on the device - allow to computer to control the device.

Configure webdriver properties

# +++ Appium + Android +++
webdriver.type=appium
webdriver.appium.url=http://127.0.0.1:4723/wd/hub
# this setting is ignored for Android but it is required
webdriver.cap.deviceName=Galaxy Tab 2
# fetch your device id using command "adb devices" from android sdk
webdriver.cap.udid=device id
webdriver.cap.platformName=Android
webdriver.cap.platformVersion=4.4
webdriver.cap.browserName=Chrome

Make sure you use proper deviceName as returned by adb devices. Bobcat tests should now run mobile device.

Running tests using Android emulator

Before you run a test using android emulator you should create an android virtual device profile using the avd tool from Android SDK. If you wish to use Chromium browser on your emulated android device you have to fetch latest version from http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?prefix=Android/ and install it on the emulator using adb install CHROMIUM-PACKAGE-NAME

Configure web-driver as follows:

# +++ Appium + Android Emulator +++
webdriver.type=appium
webdriver.cap.automationName=Appium
webdriver.appium.url=http://127.0.0.1:4723/wd/hub
# this setting is ignored for Android but it is required
webdriver.cap.deviceName=emulator-5554
# Name of the android virtual device to launch
webdriver.cap.avd=Test1b
webdriver.cap.avdLaunchTimeout=600000
webdriver.cap.avdReadyTimeout=600000
webdriver.cap.newCommandTimeout=360
webdriver.cap.platformName=Android
webdriver.cap.platformVersion=4.4
webdriver.cap.app=Chromium
webdriver.cap.browserName=Chromium
webdriver.mobile=true

Make sure you use proper avd (Android device name). The emulator should be started automatically by appium if it is not running. Bobcat tests should now run mobile device.

iOS

You can create a universal Appium instance that handles both iOS and Android devices. You will java jdk, ant and Android sdk.

./reset.sh --ios --real-safari --code-sign "iPhone Developer: Dev (ID)" --profile profileHash --verbose --force --android --chromedriver-version 2.11

Properties

Use following webdriver.properties in your project to run the tests on iPhone:

# +++ Appium + iOS +++
webdriver.type=appium
webdriver.appium.url=http://127.0.0.1:4723/wd/hub
webdriver.cap.deviceName=iPhone
webdriver.cap.udid=device id
webdriver.cap.platformName=iOS
webdriver.cap.platformVersion=7.1.0
webdriver.cap.browserName=Safari
webdriver.mobile=true

Getting started with Bobcat

  1. Getting started

AEM Related Features

  1. Authoring tutorial - Classic
  1. AEM Classic Authoring Advanced usage
  1. Authoring tutorial - Touch UI
Clone this wiki locally