Slide 1

Slide 1 text

Appium @ TestLeaf

Slide 2

Slide 2 text

Automating iPhone Apps using Appium

Slide 3

Slide 3 text

OS Market Share Hence we train 5 classes on Android & 3 classes on iOS

Slide 4

Slide 4 text

iOS Distribution We have multiple iPad and iPhones of 9.x and 8.x

Slide 5

Slide 5 text

Native vs. Hybrid vs. Mobile

Slide 6

Slide 6 text

• MAC 10.11 El Capitan [OS] • Xcode 7.3 [Apple’s integrated development environment] • JDK 1.8 • Eclipse 4.x • brew [Helps install software on Macs] • node and npm [Node’s package manager] • appium 1.5.2 server and java client 3.3 • Selenium 2.53.0 • ideviceinstaller • ios_webkit_debug_proxy Installation Preview

Slide 7

Slide 7 text

Appium iOS – Working methodology

Slide 8

Slide 8 text

Appium uses Apple’s UIAutomation (JavaScript library to write test scripts that exercise your iOS app’s user interface elements while the app runs on a connected device) and which is provided under the Apple Instruments framework. Appium iOS

Slide 9

Slide 9 text

Appium iOS Support Version 7.1, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 9.2 and 9.3 Devices iPhone Simulator, iPad Simulator, and real iPhones and iPads Native app support Yes, with debug version of .app (simulator), or correctly-signed .ipa (real devices). Underlying support is provided by Apple’s UIAutomation framework. Mobile web support Yes, via automation of mobile Safari. For real devices, ios- webkit-remote-debugger is required, and automation of native aspects of the Safari interface is not possible Hybrid support Yes. For real devices, ios-webkit-remote-debugger is required Multiple apps in one session / Multiple devices simultaneously No

Slide 10

Slide 10 text

1. An Apple Developer ID and a valid Developer Account with a configured distribution certificate and provisioning profile. 2. An iPad or iPhone. Make sure this has been set up for development in Xcode. 3. A signed .ipa / .app file of your app, or the source code to build one. 4. A Mac with Xcode and the Xcode Command Line Developer Tools Real Devices

Slide 11

Slide 11 text

XCode

Slide 12

Slide 12 text

Xcode is Apple’s integrated development environment (IDE) that you use to build apps for Apple products including the iPad, iPhone, Apple Watch, and Mac. Xcode provides tools to manage your entire development workflow— from creating your app, to testing, optimizing, and submitting it to the App Store. Xcode

Slide 13

Slide 13 text

Using Xcode Provisioning Profiles

Slide 14

Slide 14 text

A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing A valid iOS Development Distribution Certificate and Provisioning Profile are necessary to test on a real device. Your app will also need to be signed. Provisioning Profile

Slide 15

Slide 15 text

Device Provisioning

Slide 16

Slide 16 text

Signing Identities

Slide 17

Slide 17 text

• Enterprise apps (they are signed with distribution certs) • App Store apps (they are signed with distribution certs) • Apps sent over AirWatch (they are signed with distribution certs) You cannot automate If you have an internal app that is an Enterprise App, you can resign it and then install it to the device to be automated. The point is you need access to the development certificate and profile to re sign it. .ipa with a "Development" provisioning profile that can be automated -- NOT a "Development Distribution" profile

Slide 18

Slide 18 text

Make sure UI Automation is enabled on your device. Settings -> Developer -> Enable UI Automation Tip of the hour

Slide 19

Slide 19 text

Running Appium on Mac OS X

Slide 20

Slide 20 text

• Can be either .app or node • Xcode version 7.1 is recommended as earlier versions of Xcode are limited in which versions of iOS they can test against. • You need to authorize use of the iOS Simulator Appium Setup

Slide 21

Slide 21 text

Appium on iOS

Slide 22

Slide 22 text

iOS Settings

Slide 23

Slide 23 text

iDeviceInstaller

Slide 24

Slide 24 text

ideviceinstaller is a tool to interact with the installation_proxy of an iOS device allowing to install, upgrade, uninstall, archive, restore and enumerate installed or archived apps. It makes use of the libimobiledevice library that allows communication with iOS devices. ideviceinstaller brew install --HEAD ideviceinstaller Fruitstrap (1.4.0)

Slide 25

Slide 25 text

ios_webkit_debug_proxy (aka iwdp) allows developers to inspect MobileSafari and UIWebViews on real and simulated iOS devices ios-webkit-debug-proxy brew install ios-webkit-debug-proxy Your attached iOS devices must have ≥1 open browser tabs and the inspector enabled via: Settings > Safari > Advanced > Web Inspector = ON

Slide 26

Slide 26 text

https://github.com/appium/ios-uicatalog UICatalog – Sample iOS Application

Slide 27

Slide 27 text

Appium Class Schedule