Appium meet up noida

30
Appium: Mobile Automation Made Awesome

Transcript of Appium meet up noida

Page 1: Appium meet up noida

Appium: Mobile Automation Made Awesome

Page 2: Appium meet up noida

AGENDA

Introduction to Mobile Automation $ Why Appium??

Mobile Web Automation using Appium

iOS Native Apps Automation

Android Native Apps Automation

Page 3: Appium meet up noida

MOBILE TESTING MYTHS• Testing on Emulator is enough

• Testing on 4 to 5 most common devices is enough

• Exploratory testing just before the launch is enough

• Users will understand if there are some issues in the app

Page 4: Appium meet up noida

NOW SOME MOBILE TESTING FACTS

• Application not working and having bugs is #1 reason for uninstalling the app.

• Quality reasons are #1 reason for bad reviews in Marketplace(80%). Application content related issues are only 20%

• 60% of mobile users will abandon your app or site if it doesn’t load with in 3 seconds. Three seconds! Of those users, 43% said they would ever return to your app or site.

• 32% of the users reports a negative review on the marketplace for every crash they face.

Page 5: Appium meet up noida

WHY MOBILE AUTOMATION REQUIRED???• Multiple platforms (iOS, Android, Windows, Blackberry)

• Multiple OEMs (Samsung,Apple,LG,Motorola,Sony and many more)

• Different screen resolutions

• Cost of a leaked defect is quite high

• Frequent releases of the apps

• Any changes in the app needs testing of the whole app

• Different Network types(2G,3G,4G,Wifi)

• Quality apps can only sustain in such enormous Appstores/Markets

Page 6: Appium meet up noida

AUTOMATIONS PARADIGMS : UI INTERACTION

VISUAL PROGRAMMATIC

No Interaction with application code Use application code to interact with UI elements

Verify appearance of UI elements Verify presence and state of UI elements

Beware of intended visual changes like screen resolution

Beware of code changes that don’t affect layout of element properties

Page 7: Appium meet up noida

AUTOMATIONS PARADIGMS : COMMUNICATION

USB(Lab) HTTP(User Agent)

Tool interacts with the application via USB Tool interacts with the application via http request

Dependency on the native APIs offered by the platform

Tool and the mobile device should be in same network

No modifications in the app are required App needs to be modified to place http listener inside it.

Page 8: Appium meet up noida

NEW PARADIGM: MOBILE AUTOMATION ROBOT

TAPSTER

Page 9: Appium meet up noida

TOOLS AVAILABLE

Paid/Licensed:

Calabash Android MonkeyTalk Robotium UIAutomator Selendroid Sikuli Appium Espresso

Open Source:

Ranorex Perfecto Mobile Cloud DeviceAnyWhere TestObject SeeTest Eggplant TenKod

Page 10: Appium meet up noida

WHAT TO LOOK IN A MOBILE AUTOMATION TOOL• Native, Hybrid and Mobile Web Support

• On-Demand Cloud Testing

• Integration with Key Support Systems

• Cross Platform Support

• Scalability

Page 11: Appium meet up noida

WHY APPIUM ?

Page 12: Appium meet up noida

WHY APPIUM ?

Page 13: Appium meet up noida

APPIUM’S HIGH LEVEL ARCHITECTURE

Selenium WebDriver Script

(C#,Java,Perl,Python,PHP)

Server written in node.js

 

IDE

JSON WIRE Protocol via http

UIAutomation

request via

USB

UIAutomator/Selendroid

request via USB

Page 14: Appium meet up noida

APPIUM’S ARCHITECTURE

Appium is an HTTP server that creates and handles WebDriver sessions

Appium starts a “test case” on the device that spawns a server and listens for proxied commands.

On iOS appium proxies commands to a UIAutomation script running in Instruments

On Android, appium proxies commands to a UiAutomator test case running on the device

Page 15: Appium meet up noida

ARCHITECTURE - IOS

Page 16: Appium meet up noida

ARCHITECTURE - ANDROID

Page 17: Appium meet up noida

APPIUM ROADMAP• Architectural Changes• Apple Watch Support• Better Documentation• Re-building Appium GUI with ‘Electron’ to have a single code

base• Replacing UIAutomator with DroidDriver• Plans to have a non-UIAutomation iOS backend (Calabash)

Page 18: Appium meet up noida

APPIUM REQUIREMENTS• Mac 10.9+ with XCode and iOS SDK

• Android SDK with emulators

• Node.js + NPM

• Java

• Appium Client in your language

• Test Runner in your language

Page 19: Appium meet up noida

MOBILE WEB AUTOMATION ON ANDROID

Page 20: Appium meet up noida

MOBILE WEB AUTOMATION ON IOS

Page 21: Appium meet up noida

IOS NATIVE APPS AUTOMATION

Page 22: Appium meet up noida

Please visit: http://careers.3pillarglobal.com/

Page 23: Appium meet up noida

BREAK TIME!!!

Page 24: Appium meet up noida

Android Native App Automation

Using Appium (Java Client)

Page 25: Appium meet up noida

Start with APK

• Sign APK With Own

Certificate

• Android Driver And

Mandatory

Capabilities

• APK Installation &

Uninstallation

SDK Tools Utilization• Ui Automator Viewer• How To Locate Element.• Important ADB Commands• Monitor• Identify Package And Activity

Name

APK Features Coverage• Launch, Reset And Close App• Mobile Gestures (Scroll, Tap ,

Swipe, Rotate)• Hide Keyboard And Lock Screen• Switch b/w Native And Web

View• Geo Location Setting• Run App In Background• Switch B/W Different Apk• Upload And Download File

INDEX

Page 26: Appium meet up noida

START WITH APK

Sign APK With Own Certificate

Android Driver And Mandatory Capabilities

APK Installation & Uninstallation

Page 27: Appium meet up noida

SDK TOOLS UTILIZATION

UI AUTOMATOR1- WHY WE NEED2- WHERE TO FIND3- HOW TO USE

HOW TO LOCATE ELEMENT

IMPORTANT ADB COMMANDSadb devices adb pull –p <remote> <local>adb install <file> adb push –p <local> <remote>

adb uninstall <package> adb start-serveradb kill-server adb get-state ( offline | bootloader | device)adb status-window adb root

Identify Package And Activity Nameaapt dump badging <path-to-apk> | grep “package:\ name”

Monitor adb logcat –d adb logcat –f <fileName> -r 1024 –n 8 (leave it running)

Page 28: Appium meet up noida

APK FEATURES COVERAGE

Launch, Reset, Close and Remove App

Switch B/W Native And Web View

Geo Location Setting and UI Automator directly

Hide Keyboard, Lock Screen and Run App in background

Switch b/w different Apps

Upload And Download File

Mobile Gestures (Scroll, Tap, Swipe, Rotate)

Andr

oid

Driv

er

Launch(), Reset(), closeApp(), removeApp(bundleId);

getContextHandles(), getContext()

setLocation(Location), new UiSelector().className(\"EditText\")

hideKeyboard(), lockScreen(timeInSecond)

runAppInBackground(timeInSecond)

new AndroidDriver(URL, Capabilities)

pullFile, pullFolder(remotepath), pushFile()

Tap, Swipe, rotate,scrollTo, scrollToExact

Page 29: Appium meet up noida

Q & A

Page 30: Appium meet up noida

References: http://devops.com/2015/06/23/choosing-mobile-test-automation-solution-need-know/

• https://viennamobilequalitycrew.wordpress.com/2015/04/13/interview-mit-dan-cuellar-thedancuellar-a-closer-look-at-appium/

• https://www.dropbox.com/s/rhuma8nvmwsurjw/ltg-workshop.pdf?dl=0

• https://github.com/appium/appium/blob/master/ROADMAP.md