Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mobile Automation with Appium

633 views

Published on

Appium 2018: An Appium related talk that I delivered at an Melbourne meetup.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Mobile Automation with Appium

  1. 1. Mobile Automation with Appium Manoj Kumar
  2. 2. About Me ✓Open Source Enthusiast (Selenium, ngWebdriver, Serenity, Protractor et..) ✓Author assertselenium.com & official documentation of Selenium ✓Organizer & Program Chair seleniumconf.com ✓Member of Project Leadership committee - Selenium ✓Accessibility enthusiast ✓I work at Applitools AI-POWERED VISUAL TESTING AND MONITORING
  3. 3. Today’s Session ✓Challenges of Mobile Automated testing ✓Getting started with Automated Mobile Testing -Appium ✓Advanced features and unique capabilities ✓Scaling your Appium tests ✓State of Mobile Automation testing tools ✓& More
  4. 4. TOO MANY DEVICES + BROWSER COMBINATIONS TO TEST TEST MATRIX IS TOO BIG TO COVER MANUALLY
  5. 5. RELEASE CYCLES KEEP GETTING SHORTER CI-CD PROCESSES DEMAND AUTOMATION AND ZERO MANUAL BOTTLENECKS
  6. 6. Automate it!
  7. 7. Challenges - Mobile Automation • Validate every OS version your app supports • Validate every locale your app supports • Validate different device manufacturers • Validate performance of your mobile apps • Simulator vs Real Device differences
  8. 8. Tools / Frameworks
  9. 9. Be Honest
  10. 10. Detox WDA Tool Stack
  11. 11. Appium
  12. 12. Appium Philosophy • Test the Same app you submit to the marketplace • Write automated tests in any language / framework • An open-source mobile automation framework • Come up With your own driver implementation
  13. 13. Appium • Appium is a HTTP server that creates and handles WebDriver session through Mobile JSON WP
  14. 14. Appium Architecture • Similar to WebDriver Server • A Client-Server architecture • Server - Node Js • Client - your Automated Scripts • Receive request from Client > Executes commands on devices/emulators > A HTTP response is responded
  15. 15. Appium Architecture • When you download Appium Desktop or install via npm - you’re just downloading or setting up the Server part of Appium • When you write an automated Appium Script and execute it, a HTTP request in JSON format is sent to Server • Appium sends the commands to iOS and Android platform in a way that it understands via bootstrap- which acts as a Unix/TCP server
  16. 16. Appium in a Nutshell
  17. 17. Appium Landscape
  18. 18. Source: Jonathan Lipps- CloudGrey
  19. 19. Appium Requirements • Appium via npm server • Driver Specific Setup • XCUITest Driver - iOS • Mac, Xcode > 7, XCUITest library • UiAutomator2 Driver( EspressoDriver at it Beta Stage) - Android • Java 7, Android SDK • Windows Driver - Win Desktop Apps • Mac Driver - Mac Desktop Apps
  20. 20. Appium Server
  21. 21. Appium Driver Service
  22. 22. Desired Capabilities
  23. 23. Appium Inspector
  24. 24. Advanced Appium Actions Name Some please?
  25. 25. Horizontal Swiping Thanks - Srinivasan & Sai
  26. 26. Vertical Swiping
  27. 27. Vertical Swiping Thanks - Srinivasan & Sai
  28. 28. Chained Locators
  29. 29. Any Possible Thanks - Srinivasan & Sai
  30. 30. Tips & Tricks • No XPath • Use Predicates in iOS • Appium is slow • Stability over speed • No Docs
  31. 31. Performance Testing for Mobile apps • Mobile apps are usually run in a very constrained environment • Mobile apps have the potential to create bad user experience not only from UI perspective but also by jamming CPU or memory and shown as a “battery draining app”
  32. 32. • At least with Android • dumpsys is a tool that runs on Android devices and provides information about services and can be used wth Android Debug Bridge • Allow you to check how your application affects the overall device through CPU, RAM, Battery, storage stats List<List<Object>> data = driver.getPerformanceData("io.appium.android.apis", "memoryinfo", 10); Performance Testing with Appium
  33. 33. Visual Testing for mobile Apps • Validate if your app looks same on different screen sizes, different manufacturers • How will your app layout or structure looks when used in different language which has long strings like Deutsch • Consider testing in Landscape mode
  34. 34. AI-POWERED VISUAL TESTING AND MONITORING
  35. 35. Accessibility Testing for Mobile Apps • All activatable elements should be focusable • The user flow on the screen should be from top to bottom and left to right. The flow throughout the app should be intuitive.
  36. 36. Accessibility testing with Espresso • Accessibility Test framework from Google - Plugged into any Java framework • Espresso: import android.support.test.espresso.contrib.AccessibilityChecks; @RunWith(AndroidJUnit4.class) @LargeTest public class AccessibilityChecksIntegrationTest { @BeforeClass public static void enableAccessibilityChecks() { AccessibilityChecks.enable(); } }
  37. 37. Scaling Mobile Automation
  38. 38. Scaling Mobile Automation • Dockerize Appium Tests - Easy Parallel tests • Docker based Setup • https://github.com/butomo1989/docker-android • https://github.com/appium/appium-docker-android • No more worry about requirements • Comes pre-built in a docker image • Build an Image and execute it!
  39. 39. Scaling Mobile Automation • Appium Test Distribution • Appium Device Manager • Remote Appium Manager
  40. 40. Video Demo
  41. 41. Mobile Automation landscape
  42. 42. Mobile Testing tools-Landscape
  43. 43. Questions Thank you!

×