How to perform automation scripts on chrome android with appium

1.     Requirements

1.1    Android Developer Tool >= 16

           http://deveper.android.com/sdk/index.html

1.2. Set environment variables:

  • ANDROID_HOME=/path/to/android_sdk/
  • PATH=%PATH%;%ANDROID_HOME%

1.3. Appium

 Download at: https://bitbucket.org/appium/appium.app/downloads/AppiumForWindows_1_4_0_0.zip

1.4. Chrome for android:

Go to google play and download chrome then install chrome on android device.

2.     Setup

Deep dive on getting Appium Server Capabilities (Caps)

2.1 Find platformVersion:

On your Android device the platformVersion is the Android Version

  • Go to Settings -> About Phone
  • Read Android Version
  • If need truncate to one decimal place.  i.e. 4.4.4 to 4.4
  • Example:platformVersion: ‘4.4’

appim-chrome-android2

 2.2 Find browserName:

  • Go to Settings -> Apps
  • Read Browser Name
  • Example: browserName: ‘Chrome’
  • appim-chrome-android3

2.3 Find deviceName:

  • Go to Settings -> About Phone -> Status
  • Read Serial number
  • Example: deviceName: ‘TA96515UMI’

appim-chrome-android4

 3. Appium – Android Settings

  • Select Platform Name in pull down: Android
  • Select Automation Name in pull down: Appium
  • Select Platform Version in pull down (Overwrite if necessary)
  • Example: 4.4 KitKat (API Level 19)
  • Check Device Name then enter Device Name
  • Example: TAxxxUMI

appim-chrome-android5

 4. Enable Developer Options on your Android Device

Hidden away from the average user but easy to enable is Developer options.

4.1 First step, plug your device into your PC via USB

You need to navigate to “Build Number” unfortunately it can be in different places on the Android Devices.  Below are command locations to find it:

  • Stock Android: Settings -> About phone -> Build number
  • Samsung Galaxy S5: Settings -> About device -> Build number
  • LG G3: Settings -> About phone -> Software information -> Build number
  • One (M8): Settings -> About -> Software information -> More -> Build number
  • Setting screen before Developer options is enabled:

appim-chrome-android6

4.2 After finding the “Build number” then taps on the section 7 times.

After two taps a notification pop should appear saying “you are now ‘X’ steps away from being a developer” then count down until after the 7th tap and it will say “You are now a developer!”   A Developer options section will now be press

appim-chrome-android7appim-chrome-android8

4.3 With Developer options enabled, now find and tap on Developer options so we can enable USB Debugging.

  • Check USB debugging
  • OK “Allow USB debugging”
  • OK “Allow USB debugging” for a computer with RSA Key
  • Click “OK” to Allow USB debugging

appim-chrome-android8-1

  • Click “OK” to Allow USB debugging for computer

appim-chrome-android9

 5. Make Sure Device Is Connected

  • Connect your device to your Mac via USB
  • Open Terminal
  • $ adb devices

You should see the Device Name

appim-chrome-android10

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.