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

Advanced Mobile Testing on Sauce Labs

Sauce Labs
September 19, 2013

Advanced Mobile Testing on Sauce Labs

Sauce Labs

September 19, 2013
Tweet

More Decks by Sauce Labs

Other Decks in Technology

Transcript

  1. Jonathan Lipps
    Sr Developer | @jlipps | @saucelabs
    Advanced Mobile Testing on Sauce
    (9/19/2013)
    Promo code: mobilewebinar2
    1,000 free testing minutes

    View Slide

  2. Agenda
    1.
    2.
    3.
    4.
    5.
    6.
    Recap
    Intro to Android
    Webviews and Hybrid Apps
    Gestures & Special UI Elements
    The Future of the Appium API
    Q & A

    View Slide

  3. Sauce Labs is a testing platform
    used by thousands to securely test
    mobile and web apps.

    View Slide

  4. http://saucelabs.com/mobile

    View Slide

  5. Appium is the open-source, cross-
    platform solution for native and
    hybrid mobile automation

    View Slide

  6. http://appium.io

    View Slide

  7. Open-source
    Simulators
    Real devices
    Native apps
    Hybrid apps
    Mobile Web
    Robot-controlled
    Sauce
    Simulators
    Real devices
    Native apps
    Hybrid apps
    Mobile Web
    Robot-controlled

    View Slide

  8. Appium has the same client /
    server architecture and uses the
    same protocol as Selenium

    View Slide

  9. Android support works the same
    way as iOS, but with a different set
    of desired capabilities.

    View Slide

  10. View Slide

  11. View Slide

  12. Review: Sending apps to Sauce
    Host the app on the web
    Use the Sauce Storage API
    https://saucelabs.com/docs/rest#storage
    1.
    2.

    View Slide

  13. View Slide

  14. https://saucelabs.com/jobs/3c55bc37fc334dc2946c9720caf0c909

    View Slide

  15. Android Locator Strategies

    View Slide

  16. Older Android Versions
    If you specify an Android version < 4.2, Appium
    on Sauce will give you a Selendroid* session.
    Selendroid is a project bundled with Appium
    enabling older device and webview automation.
    *Selendroid’s API is slightly different from Appium’s! http://selendroid.io/ for
    details

    View Slide

  17. Automating Webviews on iOS
    1. Start native app automation
    2. webview_ids = d.window_handles()
    3. d.window(webview_ids[0])
    4. Automate webview using WebDriver
    5. d.execute_script(“mobile: leaveWebView”)

    View Slide

  18. View Slide

  19. Automating Webviews on Android
    1. Use webview support desired cap*
    2. d.window(“WEBVIEW”)
    3. Automate webview using WebDriver
    4. d.window(“NATIVE”)

    View Slide

  20. View Slide

  21. Gestures!
    Existing WebDriver actions work as expected:
    But these don’t cover all the behaviors we want
    in a mobile app.

    View Slide

  22. Gestures!
    For the rest, the temporary solution is to use a
    suite of special methods:

    View Slide

  23. Gestures!
    Each of these methods takes a certain set of
    parameters, for example:
    Docs: https://github.com/appium/appium/blob/master/docs/gestures.md

    View Slide

  24. Gestures!
    Some methods differ across platforms, based on
    the underlying automation APIs. For example,
    “mobile: shake” currently works only on iOS.
    Docs: https://github.com/appium/appium/blob/master/docs/gestures.md

    View Slide

  25. Gestures!
    Methods that deal with x/y coordinates take
    relative parameters (0.0 < X <= 1.0) or
    absolute pixel values (1 < X)
    Docs: https://github.com/appium/appium/blob/master/docs/gestures.md

    View Slide

  26. Special UI Elements
    The values of some special UI elements can be
    set using send_keys()*:
    * this is currently only supported on iOS

    View Slide

  27. The Future of the Appium API
    execute_script(“mobile: ...”) is a temporary
    solution to enable all client libraries access to
    special mobile methods. It is not ideal because it
    doesn’t provide native client access to those
    behaviors.
    Likewise, the difference between Appium’s
    Android API and Selendroid’s API makes it
    difficult to write cross-platform hybrid tests.

    View Slide

  28. The Future of the Appium API
    Appium developers have been working with the
    WebDriver project to make mobile gestures
    rst-class citizens in the WebDriver clients.
    We have also been working with other mobile
    automation frameworks like Selendroid to
    standardize our APIs. Look for great updates
    soon!

    View Slide

  29. Questions?
    @saucelabs | @appiumdevs | @jlipps
    Promo code: mobilewebinar2
    1,000 free testing minutes

    View Slide

  30. Thanks!
    @saucelabs | @appiumdevs | @jlipps
    Promo code: mobilewebinar2
    1,000 free testing minutes
    We’re hiring! http://saucelabs.com/careers

    View Slide