1 of 41

Overview

for device farms

Anna Kluevaannaklueva888@gmail.com

2 of 41

Anna Klueva

Position: Automation QA Engineer at Grid Dynamics

Experience: 5 years & 2 years in mobile automation

Email: annaklueva888@gmail.com

3 of 41

Agenda

  • Why cloud?
  • Overview of device farms:
    • Kobiton
    • Saucelabs
    • AWS Device farm
    • Bitbar
  • Parallelization
  • Summary

3

4 of 41

4

Emulator

Real device

vs.

5 of 41

Why cloud?

5

6 of 41

6

7 of 41

Kobiton: Pros & Cons

Privileged and Confidential

7

  • Easy of use
  • Easy of setup
  • Reporting: no affect on custom reports
  • Cheap

Pros

  • Supports ONLY Appium
  • Appium version can't be changed

Cons

8 of 41

Kobiton: How it works?

1) Upload app to Kobiton

2) Configure Driver and desired capabilities in your project

3) Run test on local machine

Example of configuration: String APPIUM_URL ="https://username:apiKey@api.kobiton.com"; driver = new AndroidDriver<MobileElement>(�new URL(APPIUM_URL+"/wd/hub"), Configuration.getCapabilities()); private static DesiredCapabilities getCapabilities() {� DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", “Galaxy Note3”); capabilities.setCapability("platformVersion", “6”);� capabilities.setCapability("platformName", "Android");� capabilities.setCapability("app", pathToRemoteApp); return desiredCapabilities;� }

8

9 of 41

9

10 of 41

Kobiton: Api description

Upload App to repo

Get info about devices

Get device status

Get logs info

10

11 of 41

Kobiton: How CI/CD process can be organized?

Kobiton Api

11

12 of 41

Kobiton: Specific feature

  1. Health-check for your application
  2. Supports different build tools: Maven, Gradle

12

13 of 41

13

14 of 41

Saucelabs: Pros & Cons

14

  • Support different frameworks
  • Easy of use
  • Easy of setup
  • Reporting: no affect on custom reports

Pros

  • Not cheap

Cons

15 of 41

Saucelabs: How it works?

  1. Upload app via Api
  2. Configure driver and DesiredCapabilities
  3. Run tests

15

String APPIUM_URL =https://eu1.appium.testobject.com”;�driver = new AndroidDriver<MobileElement>(new URL(APPIUM_URL+"/wd/hub"), Configuration.getCapabilities());

private static DesiredCapabilities getCapabilities() {� DesiredCapabilities desiredCapabilities = new DesiredCapabilities();� desiredCapabilities.setCapability("platformName","Android");� desiredCapabilities.setCapability("testobject_api_key", SAUCELABS_API_KEY);� desiredCapabilities.setCapability("testobject_app_id", SAUCELABS_UPLOADED_APP_ID);� return desiredCapabilities;�}

16 of 41

16

17 of 41

Saucelabs: Api

Saucelabs (TestObject) provides:

17

Storage API (upload app)

Test Reports API

Logs API

Devices API

Appium Suites API

18 of 41

Saucelabs: How to integrate with CI/CD flow?

Two ways:

  1. Sauce plugins for Jenkins, TeamCity, Bamboo
  2. API

18

19 of 41

Saucelabs: Specific feature

Automated Quality Report

Tests included in the Quality Report are:

  • Install and Launch tests
  • Stress tests

19

20 of 41

AWS Device farm

20

21 of 41

AWS Device farm: Pros & Cons

21

  • Supports different frameworks
  • Ability to test specific cases
  • Rich test analytics

Pros

  • No local run
  • No custom reports, just aws reports

Cons

22 of 41

AWS Device farm: How it works?

1) Your project with tests:

1. Configure Driver and DesiredCapabilities�2. Archive project

2) AWS: Upload application to AWS Device farm

3) AWS: Upload zipped project to aws

5) AWS: Select device and run type

6) AWS: Run test on server

22

Example:

String APPIUM_URL = “http://127.0.0.1:4723”;�driver = new AndroidDriver<MobileElement>(new URL(APPIUM_URL+"/wd/hub"), Configuration.getCapabilities());��/*** We do not need to and SHOULD NOT set our own DesiredCapabilities* Device Farm creates custom settings at the server level. Setting your own DesiredCapabilities will result in unexpected results and failures.**/�private static DesiredCapabilities getCapabilities() {� return new DesiredCapabilities(); �}

23 of 41

23

24 of 41

AWS device farm: API description

Upload app

Upload package with tests

Get info about devices

Get info about user

Run tests on AWS Device cloud

24

25 of 41

AWS Device farm: How to integrate with CI/CD flow?

Two ways:1) Jenkins plugin

“aws-device-farm”

2) API

25

26 of 41

AWS Device farm: Specific feature

  1. Build tools: Maven, Gradle
  2. AWS Device farm client application

26

27 of 41

27

28 of 41

Bitbar: Pros & Cons

28

  • Supports different frameworks
  • Easy of use
  • Rich test analytics
  • Integration with third party systems

Pros

  • Not easy of setup
  • Not cheap

Cons

29 of 41

Bitbar: How it works?

Client-side: run tests locally on remote real devices

Server-side: run tests on Bitbar server on remote real device

29

30 of 41

Bitbar: client-side run

  1. Upload app to Bitbar server
  2. Configure Driver and DesiredCapabilities
  3. Bitbar: create project
  4. Run tests

30

Example of configuration:String APPIUM_URL = “https://appium.bitbar.com”;driver = new AndroidDriver<MobileElement>(new URL(APPIUM_URL+"/wd/hub"), Configuration.getCapabilities());

private static DesiredCapabilities getCapabilities() {� DesiredCapabilities desiredCapabilities = new DesiredCapabilities();� desiredCapabilities.setCapability("platformName","Android");� desiredCapabilities.setCapability("deviceName", "Android Device");� desiredCapabilities.setCapability("testdroid_apiKey", BITBAR_API_KEY);� desiredCapabilities.setCapability("testdroid_project", BITBAR_PROJECT);� desiredCapabilities.setCapability("testdroid_testrun", "Demo1");� desiredCapabilities.setCapability("testdroid_app",UPLOADED_APP_PATH);� desiredCapabilities.setCapability("testdroid_device","LG Google Nexus 5");� desiredCapabilities.setCapability("testdroid_target", "Android"); � return desiredCapabilities;�}

31 of 41

Bitbar: server-side run

  1. Upload app to server
  2. Configure Driver and Desired Capabilities
  3. Archive and upload your tests to Bitbar server
  4. Select devices
  5. Run tests on server

31

Example:�String APPIUM_URL = “http://127.0.0.1:4723”;driver = new AndroidDriver<MobileElement>(new URL(APPIUM_URL+"/wd/hub"), Configuration.getCapabilities());

/** app - don't change path to the .apk and .apk name. Bitbar stores you uploaded app application.apk*/��private static DesiredCapabilities getCapabilities() {� DesiredCapabilities desiredCapabilities = new DesiredCapabilities();� desiredCapabilities.setCapability("platformName","Android");� desiredCapabilities.setCapability("deviceName", "Android Device");� desiredCapabilities.setCapability("app", System.getProperty("user.dir") + "/application.apk");� return desiredCapabilities;�}

32 of 41

32

33 of 41

Bitbar: API description

Bitbar API provides:

33

Upload app

Get info about devices

Run tests and get results

34 of 41

Bitbar: How to integrate with CI/CD flow?

Two ways:

  1. Jenkins plugin: “Bitbar Run-in-Cloud”
  2. Bitbar API

34

35 of 41

Bitbar: Specific feature

  • AI Testbot and AppCrawler
  • Integration with JIRA, Slack, Hipchat

35

36 of 41

Parallelization

Parallelization in Kobiton and Saucelabs:

Parallelization in Bitbar and AWS:

Set of tests

Test cases

Result

(Runs on real devices)

Test

Test sessions/scripts

Results

(Runs on real devices)

36

37 of 41

Let’s summarize

37

Kobiton

Saucelabs

AWS Device farm

Bitbar

Easy of setup

Easy of use

Reporting tools

Documentation

Pricing

0. 10$ per minute

0. 18$ per minute

0. 17$ per minute

0. 19$ per minute

Parallel

38 of 41

Supported frameworks

38

Kobiton

Saucelabs

AWS Device farm

Bitbar

Appium

Calabash

Espresso

Robotium

XCUITest

KIF

39 of 41

Tricky cases

  1. If you use third party apps (Google Account, Apple ID), the personal data can not be deleted
  2. Appium version is updated randomly
  3. Documentation is not up-to-date

39

40 of 41

Q & A

41 of 41

Thank you!

www.griddynamics.com