46
SELENIUM CONFERENCE 2016 BANGALORE Advanced

Advanced Appium

Embed Size (px)

Citation preview

Creating an Open Source Project 0 to 100,000 Users

Selenium Conference 2016Bangalore

Advanced

Dan CuellarCreator of AppiumHead of Software Testing at FOODitPreviously at Shazam, Zoosk, and MicrosoftBS in Computer Science from Carnegie Mellon

About the Speaker

Where is Dan?

Brief Overview

Whats New in Appium 1.5

Mac & Windows Apps

Advanced AppiumVisual TestingMechanical TestingGrab BagMultiple DevicesHow to Read SMSSpeeding up the iOS SimulatorNetwork ConditioningUseful Capabilities

Ask Me AnythingAgenda

Evolution

The Most Terrifying 5 Words IN TESTING

This All Sounds Familiar

Everything is not Awesome

Time to Spread the Word

Use standardized and sanctioned APIs and techniques

Code in the language of your choiceJava, C#, Python, Ruby, Objective-C, node.js, PHP, and more

Do not modify the application under test

Keep it free and open source

Appium Philosophy

An implementation of the Selenium JSON-wire protocol that controls native and hybrid iOS and Android applicationThe most popular open source mobile functional testing frameworkWhat is Appium?

Test ScriptJSON-Wire Protocol Request

JSON-Wire Protocol Response

HTTPHow Does it Work?

In the last 3 yearsOver 3,500 Stars, 2,000 Forks on GitHubOver 150 Contributors and 5,000 commitsOver 150,000 downloads of Appium 1.0Over 3,500 issues closedBy the Numbers

Whats New

Complete rewrite of the entire codebaseContinuous Integration and Unit TestsCommand line arguments are mostly capabilities nowCode of Conduct and Governance

Whats New?

3 years of patches and organic growthMany complaints about instabilityCode was not modular enoughOld and confusing ES5 codeCallback HellPoorly Tested

Why Rewrite?

Windows Phone and Windows 10 application supportNew GUIsMultiple New iOS BackendsAndroid backend rewrite using UIAutomator 2Better docs and onboarding materialAppium FoundationComing Soon

Desktop Apps

https://github.com/Microsoft/WinAppDriverWindows Support

Windows Supporthttps://github.com/2gis/Winium

Mac Apps

https://github.com/appium/appium-for-mac

Advanced

Multiple Devices

Part Deux

Add visual validation to your existing Appium testsCover content, data, layout and appearance of all the UI elements with a single checkpoint for an entire pageValidate the look & feel of your application/website UI on all platformsAutomated maintenance of the baseline images across multiple devices / screen sizes

Visual Testing

Find By Imagehttps://medium.com/@SimonKaz/appium-with-image-recognition-17a92abaa23d#.cdfhwinzk

Robot

Calibrate the robot to map points in the physical world to points on a device screenRun an app on the device with Appium that can tell you what coordinates are being touchedTouch three places on the device and record the physical and device-centric coordinatesBuild a matrix to translate any point between the two systemsIntercept touch actions with the Appium Server and send them to the robotHow Does it Work?

The Math

Grab Bag

WebDriverAgenthttps://github.com/facebook/WebDriverAgentMultiple SimulatorsAll ApplicationsXCUITestCreated by AppleBetter support for future versions of iOSNew iOS Backends

SMS as Alert

Xcode 7 and iOS 9 do not support installing the speedup tool automatically that previous versions of Appium usedNo worries, you can install it manuallyhttps://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd_xcode7.mdNow your iOS tests will be fast againSlow iOS Simulator

AndroidautoWebView start in the webview context (really useful for Cordova apps)AndroidignoreUnimportantViews can speed up your Android testsnativeWebScreenshot takes the screenshot from UIAutomator instead of chromedriverCapabilities

iOSlocationServicesAuthorized pre-authorizes location services (prevents an alert)Auto[Accept|Dismiss]Alerts useful to prevent alertsnativeWebTap uses non-javascript taps on web contentsafariIgnoreFraudWarning allows https without proper certsinterKeyDelay - time between keystrokessendKeyStrategy (oneByOne, grouped, or setValue)Capabilities

driver.setNetworkConnection(value) [Android only]

Network ConditioningValue (Alias)DataWifiAirplane Mode0 (None)0001 (Airplane Mode)0012 (Wifi only)0104 (Data only)1006 (All Network on)110

Ask Me Anything

Takeaway

Personal TAKEAWAYLife can be much broader once you discover one simple fact: Everything around you that you call life was made up by people that were no smarter than you and you can change it, you can influence it, you can build your own things that other people can use.

Once you learn that, you'll never be the same again.

-Steve Jobs