TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium 2/24

24
5/1/2014 Testing Mobile with Appium http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 1/24 TESTING MOBILE WITH APPIUM Fil Maj, Mobile R&D, Sauce Labs @filmaj

Transcript of TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium 2/24

Page 1: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 1/24

TESTING MOBILE WITHAPPIUM

Fil Maj, Mobile R&D, Sauce Labs@filmaj

Page 2: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 2/24

Page 3: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 3/24

Page 4: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 4/24

Page 5: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 5/24

TESTING, CONT.

WHO CARES?Biggest embarassment as a programmer: regressions

Be disciplined at your craft: write a test for each bug

Run your tests after each change. This will prevent regressions.

Over time you grow a set of tests for your application

Page 6: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 6/24

Page 7: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 7/24

CONTINUOUS INTEGRATION

CI automates the testing process. You get continuous feedbackas your codebase evolves - in real-time

Page 8: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 8/24

TESTING DESKTOPWEBSITES

Established testing system is in place: Selenium.

Page 9: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 9/24

TESTING MOBILE

Not so easy.

"Rent" time from a device testing serviceLittle to no automation (usually simulator based)Not much different from a monkey

Page 10: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 10/24

SELENIUM CAN SAVE US

Open Source and Open Spec FTW

Page 11: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 11/24

WHAT IS SELENIUM?Simply put: it is an HTTP APIDeveloped out of a need to test websitesNaturally this started on desktop

Page 12: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 12/24

HOW DOES SELENIUM WORK?

Page 13: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 13/24

Page 14: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 14/24

SELENIUM TESTSScripts can be written in a variety of languages, as there are

many "client" libraries

JavaScript, Ruby, Java, C, you name it.

Page 15: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 15/24

SELENIUM ON MOBILEAPPIUM

http://appium.io

http://github.com/appium/appium

npm install -g appium

Page 16: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 16/24

WHAT IS APPIUM?An implementation of Selenium for mobile

Free and Open Source

Supports Android, iOS and FirefoxOS

Works with browsers, hybrid applications, and nativeapplications

Page 17: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 17/24

ALL TYPES OF APPS!?That's right!

Page 18: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 18/24

SELENIUM IS EVOLVING

The spec is being pushed to address new automation needs

Different types of apps, different types of interactions

Page 19: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 19/24

Page 20: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 20/24

APPIUM DEMOS

http://github.com/filmaj/appium-test

Page 21: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 21/24

Page 22: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 22/24

SELENIUM IS HARD

Lots of moving parts

Infrastructure is hard: Windows, Mac, Linux, and now mobile...

Page 23: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 23/24

Page 24: TESTING MOBILE WITH€¦ · 5/1/2014 Testing Mobile with Appium  2/24

5/1/2014 Testing Mobile with Appium

http://filmaj.ca/presentations/phillyete-2014/?print-pdf#/ 24/24

SAUCE LABS TO THERESCUE!

Let us handle the infrastructure: over 300 OS/browser combos,more being added every week

You treat Sauce Labs like just another Selenium server endpoint