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.

Selenium Camp 2016

485 views

Published on

Appium is a popular open source mobile application UI automation framework. These are the slide from Selenium Camp 2016 in Kiev.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Selenium Camp 2016

  1. 1. MOBILE AUTOMATION MADE AWESOME
  2. 2. ABOUT THE SPEAKER Dan Cuellar @thedancuellar • Creator of Appium • Head of Software Testing at FOODit • Previously at Shazam, Zoosk, and Microsoft • BS in Computer Science from Carnegie Mellon
  3. 3. THE MOST TERRIFYING 5 WORDS IN TESTING
  4. 4. THIS ALL SOUNDS FAMILIAR
  5. 5. EVERYTHING IS NOT AWESOME
  6. 6. TIME TO SPREAD THE WORD
  7. 7. WHAT IS APPIUM • An implementation of the Selenium JSON-wire protocol that controls native and hybrid iOS and Android application • The most popular open source mobile functional testing framework
  8. 8. APPIUM PHILOSOPHY • Use standardized and sanctioned APIs and techniques • Code in the language of your choice • Java, C#, Python, Ruby, Objective-C, node.js, PHP, and more • Do not modify the application under test • Keep it free and open source
  9. 9. HOW DOES IT WORK? UIAutomation / UIAutomator Appium Server Test Script JSON-Wire Protocol Request JSON-Wire Protocol Response HTTP
  10. 10. BY THE NUMBERS In the last 3 years • Over 3,000 Stars, 2,000 Forks on GitHub • Over 150 Contributors and 5,000 commits • Over 150,000 downloads of Appium 1.0 • Over 3,000 issues closed
  11. 11. @Before public void setUp() throws Exception { // set up appium File app = new File("/path/to/your/TestApp.app"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("platformVersion", ”9.1"); capabilities.setCapability("deviceName", "iPhone 6"); capabilities.setCapability("app", app.getAbsolutePath()); driver = new IOSDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); } THE CODE – IOS SETUP
  12. 12. @Before public void setUp() throws Exception { // set up appium File app = new File(”/path/to/my/test-app.apk"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName","Android Emulator"); capabilities.setCapability("automationName",”Android"); capabilities.setCapability("app", app.getAbsolutePath()); capabilities.setCapability("appPackage", ”com.yourcompany.testapp"); capabilities.setCapability("appActivity", ".HomeScreenActivity"); driver = new AndroidDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); } THE CODE – ANDROID SETUP
  13. 13. WebElement el = driver.findElement(By.className("UIAButton")); WebElement el = driver.findElement(By.xpath("//UIATextField[1]")); WebElement el = driver.findElement(MobileBy.AccessibilityId("Done")); THE CODE – FINDING ELEMENTS
  14. 14. el.click(); el.sendKeys("Hello World"); driver.swipe(sliderLocation.getX(), sliderLocation.getY(), sliderLocation.getX()-100, sliderLocation.getY(), 1000); THE CODE – ACTIONS
  15. 15. Each webview in your app is a context. Change context and automate as you would a webpage using regular selenium syntax. driver.context(contextName); WebElement el = driver.findElement(By.cssSelector(".awesome")); el.click(); AUTOMATING WEB-VIEWS
  16. 16. WHAT’S NEW IN APPIUM 1.5? • Complete rewrite of the entire codebase • Continuous Integration and Unit Tests • Command line arguments are mostly capabilities now • Code of Conduct and Governance
  17. 17. WHY REWRITE? • 3 years of patches and organic growth • Many complaints about instability • Code was not modular enough • Old and confusing ES5 code • Callback Hell • Poorly Tested
  18. 18. WHAT’S COMING NEXT • Windows Phone and Windows 10 application support • New GUIs • Multiple New iOS Back-ends • Android backend rewrite using UIAutomator 2 • Better docs and onboarding material • Appium Foundation
  19. 19. WINDOWS SUPPORT
  20. 20. https://github.com/2gis/Winium
  21. 21. NEW IOS BACK-ENDS • WebDriverAgent • https://github.com/facebook/WebDriverAgent • Multiple Simulators • All Applications • XCUITest • Created by Apple • Better support for future versions of iOS
  22. 22. ROBOTS
  23. 23. HOW DOES IT WORK? • Calibrate the robot to map points in the physical world to points on a device screen • Run an app on the device with Appium that can tell you what coordinates are being touched • Touch three places on the device and record the physical and device- centric coordinates • Build a matrix to translate any point between the two systems • Intercept touch actions with the Appium Server and send them to the robot
  24. 24. THE MATH
  25. 25. PERSONAL TAKEAWAY “Life 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
  26. 26. MORE INFO • Website: http://www.appium.io • Slack: appium.slack.com • Forum: discuss.appium.io • GitHub: http://www.github.com/appium/appium

×