Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automation of iOS Apps using Appium

Automation of iOS Apps using Appium

Gives a brief introduction about Appium and the approach to automate iOS apps.

819f16aea0a2e2bfe9e8895fe83e574d?s=128

Babu Manickam

June 16, 2016
Tweet

More Decks by Babu Manickam

Other Decks in Technology

Transcript

  1. Appium @ TestLeaf

  2. Automating iPhone Apps using Appium

  3. OS Market Share Hence we train 5 classes on Android

    & 3 classes on iOS
  4. iOS Distribution We have multiple iPad and iPhones of 9.x

    and 8.x
  5. Native vs. Hybrid vs. Mobile

  6. • 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
  7. Appium iOS – Working methodology

  8. 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
  9. 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
  10. 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
  11. XCode

  12. 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
  13. Using Xcode Provisioning Profiles

  14. 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
  15. Device Provisioning

  16. Signing Identities

  17. • 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
  18. Make sure UI Automation is enabled on your device. Settings

    -> Developer -> Enable UI Automation Tip of the hour
  19. Running Appium on Mac OS X

  20. • 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
  21. Appium on iOS

  22. iOS Settings

  23. iDeviceInstaller

  24. 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)
  25. 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
  26. https://github.com/appium/ios-uicatalog UICatalog – Sample iOS Application

  27. Appium Class Schedule