+ All Categories
Home > Software > Improving Android app testing with Appium and Sauce Labs

Improving Android app testing with Appium and Sauce Labs

Date post: 06-Aug-2015
Category:
Upload: isaac-murchie
View: 91 times
Download: 2 times
Share this document with a friend
Popular Tags:
24
© Sauce Labs, Inc. Improving Android app testing with Appium and Sauce Labs Presented by Isaac Murchie, Software Developer (Ecosystem and Integration) for Sauce Labs, Inc. May 12, 2015 Unlock the value of scalable testing for mobile apps.
Transcript
Page 1: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Improving Android app testing with Appium and Sauce Labs

Presented by Isaac Murchie, Software Developer (Ecosystem and Integration) for Sauce Labs, Inc.May 12, 2015

Unlock the value of scalable testing for mobile apps.

Page 2: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Hi! I’m Isaac Murchie.

I am an Ecosystem and Integrations developer at Sauce Labs, where I work in a variety of languages, on a variety of tools, in order to help make the experience of testing as painless as possible. I am also a core contributor to Appium, the award-winning cross-platform mobile automation framework.

Find us online

@saucelabs | @imurchie

facebook.com/saucelabs

[email protected]

Sauce Labs 539 Bryant Street, Ste. 303San Francisco, CA 94102

Page 3: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Agenda: Better testing with Appium and Sauce Labs

Writing an Android testEver tried using Android’s UI Automator?

Writing a better Android test with Appium Much better, no?

But… Scaling? What scaling.

Scaling with Sauce LabsYou don’t have to be stuck with a single device!

All the things are correct Follow your bliss.

Page 4: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Testing testing testing

Page 5: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Writing an Android testi.e., UI Automator all the things

Page 6: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android UI Automator

“The UI Automator testing framework provides a set of APIs to build UI tests that perform interactions on user apps and system apps. The UI Automator APIs [sic] allows you to perform operations such as opening the Settings menu or the app launcher in a test device. The UI Automator testing framework is well-suited for writing black box-style automated tests, where the test code does not rely on internal implementation details of the target app.”

Page 7: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android UI Automator: Example

Page 8: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android UI Automator: Pros and Cons

Pros:• Provided by Android. • Provides tools for debugging and

viewing the running app. • Can run against multiple devices by

changing the build tools.

Cons:• Text-based matching makes

localization difficult, and only supports basic Latin alphabet.

• Terrible documentation. • Slow, brittle. • In order to run against a different

device, build tools must be edited. • Tied to Java, and the tools provided. • Slow development and release

process.

Page 9: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Writing a better Android test with Appiumi.e., hiding UI Automator!

Page 10: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.© Sauce Labs, Inc.

Android on Appium: Automated Mobile Testing

“Appium is built on the idea that testing native apps shouldn't require including an SDK or recompiling your app. And that you should be able to use your preferred test practices, frameworks, and tools. Appium is an open source project and has made design and tool decisions to encourage a vibrant contributing community.”

2209 stars and 1526 forks, with 141 contributors, on GitHub.

Appium is an award-winning open source

test framework for automating native, hybrid and mobile

apps.

Page 11: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android on Appium: Example

Page 12: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android on Appium

Stop! Demo time.

Page 13: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android on Appium: How it works

Test Script Appium Server

Device Manipulation

(adb, etc)

Device Automation(UI Automator)

Android Device

HTTP

Page 14: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Android on Appium: Pros and Cons

Pros:• Open source, and based on the open

standard test protocol, Selenium WebDriver.

• Client-server architecture. • Uses Android UI Automator when

available, Selendroid otherwise. • Allow use of any language and

framework for writing tests. • Can run against multiple devices by

providing different configuration. • Supports managing device. • Full unicode support.

Cons:• Difficult setup. • Only a single Android device can be

automated at once by the server. • Lack of image recognition.

Page 15: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

ButScaling…

Page 16: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Running Appium

Page 17: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Scaling with Sauce LabsNo longer are you tied to your machine.

Page 18: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Sauce Platform: Largest Cloud for Automated Testing

• Test web + mobile apps across more than 500 platforms

• Industry standard Selenium WebDriver protocol

• Enterprise scalability + industry standard SLA

• Capture screencasts, logs + test metadata

TEST APP SAUCE CONNECT

SE DRIVERS FOR

YOUR SCRIPTJava, Ruby, Python, JS, PHP, .net

Page 19: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Appium on Sauce

Page 20: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Appium on Sauce

Stop! Demo time.

Page 21: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Appium on Sauce

A few observations: • One test took ~1 minute. Five tests took ~2 minutes. • Able to specify versions on the fly. • Use whatever framework you want to run tests in parallel.

Page 22: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.

Know that all the things are correct

Page 23: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.© Sauce Labs, Inc.

Conclusion: Testing Android Apps

Android testing is difficult, and made more so by the tools provided by the vendor

Appium solves many of the problems in Android testing by abstracting away the device and app, leaving tests to concentrate on testing.

Open to using QA best practices.

Less brittle, more intuitive.

Better control over device automation.

Page 24: Improving Android app testing with Appium and Sauce Labs

© Sauce Labs, Inc.© Sauce Labs, Inc.

Thanks!

Keep in touch!@saucelabs @imurchie


Recommended