Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
Appium solution
Appium solution
Wird geladen in …3
×

Hier ansehen

1 von 26 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Appium overview (20)

Anzeige

Aktuellste (20)

Appium overview

  1. 1. Get a start with for Mobile Automation (Android) TPC DECEMBER 2016 MEETUP BY ABHISHEK YADAV (@ABHISHEKKYD)
  2. 2. Agenda  Overview of Mobile Automation  About Appium  Overview of Appium over other open source tools  Android Installation with emulator  Scripting using Appium for Mobile Web Automation  Scripting using Appium for Mobile App Automation  Framework Development using Appium  Appium iOS Automation
  3. 3. Overview of Mobile Automation Now a days every organization prefers automated testing once a product reaches to the stable phase to reduce the testing effort. Since testing cost is an important factor for any project, organizations have started preferring open source test automation tools (which have reached a stage where they now rival the commercial ones) instead of investing in costly commercial testing tools. A variety of open source automation testing tools is available for almost all types of testing such as functional, UAT, regression, performance etc. Some open source tools are Appium, Calabash, MonkeyTalk, Robotium, etc.
  4. 4. About Appium  Appium is an open source test automation framework for use with native, hybrid and mobile web apps.  It drives iOS, Android, and Windows apps using the WebDriver protocol.  Importantly, Appium is “cross-platform”: it allows you to write tests against multiple platforms (iOS, Android, Windows), using the same API. This enables code reuse between iOS, Android, and Windows testsuites.
  5. 5. About Appium Webdriver Controller Instruments Controller Instruments Command Server Unix Socket Server Instruments Command Client Unix Socket Client Instruments Bootstrap.js
  6. 6. About Appium Webdriver Controller UIAutomator Controller UIAutomator Client TCP Client Bootstrap.jar UIAutomator Server TCP Server
  7. 7. About Appium
  8. 8. Overview of Appium over other open source tools A huge number of mobile testing tools have been developed in recent years to support mobile development. As more companies are developing mobile products and the marketplace is seeing more devices, platforms, and versions, testing your mobile apps is vital. When it comes choosing what mobile testing tool is right for you, there is a huge array of options, each with different strengths and weaknesses.
  9. 9. Overview of Appium over other open source tools
  10. 10. Android Installation with emulator  Android Studio provides the fastest tools for building apps on every type of Android device.  World-class code editing, debugging, performance tooling, a flexible build system, and an instant build/deploy system all allow you to focus on building unique and high quality apps. https://developer.android.com/studio/index.html
  11. 11. Android Installation with emulator Android Studio GUI
  12. 12. Android Installation with emulator android android avd Command Line }
  13. 13. Scripting using Appium for Mobile Web Automation DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "TestAndroid"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability(CapabilityType.BROWSER_NAME, "browser"); capabilities.setCapability("platformVersion", "5.1"); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS); driver.get("http://www.google.com"); WebElement keyword = driver.findElement(By.name("q")); keyword.sendKeys("Hello Selenium");
  14. 14. Scripting using Appium for Mobile App Automation DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "TestAndroid"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); capabilities.setCapability("platformVersion", "5.1"); capabilities.setCapability("appPackage", "com.android.calculator2"); capabilities.setCapability("appActivity","com.android.calculator2.Calculator "); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
  15. 15. Framework Development using Appium  Apache Maven  Page Objects  TestNG  ReportNG  Allure  Cucumber (BDD)  Jenkins
  16. 16. Advanced Locator Strategies  MobileBy  ByAccessibilityId  ByAndroidUIAutomator
  17. 17. MobileBy DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "TestAndroid"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); capabilities.setCapability("platformVersion", "5.1"); capabilities.setCapability("appPackage", "com.android.calculator2"); capabilities.setCapability("appActivity","com.android.calculator2.Calculator"); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS); driver.findElement(MobileBy.name("4")).click();
  18. 18. ByAccessibilityId DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "TestAndroid"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); capabilities.setCapability("platformVersion", "5.1"); capabilities.setCapability("appPackage", "com.android.calculator2"); capabilities.setCapability("appActivity","com.android.calculator2.Calculator"); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS); driver.findElement(MobileBy.name("4")).click(); driver.findElement(MobileBy.AccessibilityId("delete")).click();
  19. 19. ByAndroidUIAutomator DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "TestAndroid"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); capabilities.setCapability("platformVersion", "5.1"); capabilities.setCapability("appPackage", "com.android.calculator2"); capabilities.setCapability("appActivity","com.android.calculator2.Calculator"); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS); driver.findElement(MobileBy.AndroidUIAutomator("new UiSelector().text("3")")).click();
  20. 20. Appium iOS Automation
  21. 21. Appium iOS Automation  IosUIAutomation driver.findElementByIosUIAutomation ("tableViews()[0].cells(1).textViews() .firstWithPredicate("name == New Delhi And NCR")");
  22. 22. Selenium Version
  23. 23. Selenium 3.0 Launched!!  Selenium 3.X is no longer capable of running Selenium RC directly, rather it does it through emulation and the WebDriverBackedSelenium interface.  You’ll need to be running Java 8 to use the Java pieces of Selenium. This is the oldest version of Java officially supported by Oracle, so hopefully you’re using it already!  Support for Firefox is via Mozilla’s geckodriver.  Support for Safari is provided on macOS (Sierra or later) via Apple’s own safaridriver.  Support for Edge is provided by MS through their webdriver server.  Only versions 9 or above of IE are supported. Earlier versions may work, but are no longer supported as MS no longer supports them. http://www.helloselenium.com
  24. 24. References  http://appium.io/  https://appium.io/slate/en/tutorial/android.html  https://github.com/appium/appium  https://wiki.saucelabs.com/display/DOCS/Getting+Started+with+Appium+ for+Mobile+Native+Application+Testing

×