Android & iOS Automation Using Appium

Mindfire Solutions
Mindfire SolutionsMindfire Solutions
Android & iOS automation using
Appium
Pre se nte r : Abhishe k Swain,
Mindfire So lutio ns
About Me:
Abhishek Swain, Software QA Engineer
Mindfire Solutions
Skills : Robotium , Appium , Selenium WebDriver , Maven , Junit , SQL ....
Certifications : ISTQB Foundation Level, V-Skills Selenium Certified
Connect Me :
Facebook : http://www.facebook.com/jikun55
LinkedIn : http://in.linkedin.com/pub/abhishek-swain/58/8a/829/
Contact Me :
Email : abhishek.swain@mindfiresolutions.com /mfsi.abhishek@gmail.com
Skype: mfsi_abhishekswain
Agenda
 Introduction
 Features List
 Current Limitations
 Understanding Architecture
 Automating Android Apps
 Native/ Hybrid app
 Mobile Web app
 Automating iOS Apps
 Prerequisites and configurations
 On Simulators
 On Real iDevices
 Short Demo
 Questions & Answers
Introduction
Appium is an Open source , Cross Platform test
automation tool for mobile apps
Hosted with GitHub
 Maintained by Dan Cuellar, Jonathan Lipps and
a number of other contributors
Supports automation of Native , Hybrid and
Mobile Web apps
Based on WebDriver JSON wire protocol
Based on Client-Server Architecture
Appium Server written in Node.js
Features
Automation support for
 iOS Mobile
 Android
 Firefox mobile OS
Cross-Platform
Features
Automation support for
 Native App
 Hybrid App
 Mobile Web App
Application Types
Features
 Supports all the WebDriver Client Libraries
 Java
 Ruby
 Python
 JavaScript
 PHP
 C#
Multiple Client Libraries
Features
 Common Library for all the mobile
platforms e.g. Android , iOS
 Selenium WebDriver Interfaces
implemented
 Added mobile specific functions
e.g. driver.pinch(), driver.zoom(), driver.currentActivity(),
driver.lock() etc.
 Common API for both Native and Web
components
Common API
Features
 Android
 Real Devices
 Emulators
 Native Browser
 Mobile Chrome
 iOS
 Real iDevices (e.g. iPhone, iPad etc.)
 Simulators
 Mobile Safari
Test Modalities
Limitations
 Android
 No Support for Toast messages
 Android Version 4.2+ required
 iOS
 Needs mac OSX 10.7+, lower versions
not supported
Architecture
 Client Server Architecture
 Based on WebDriver JSON Wire Protocol
 Native test libraries of respective platform is
the backbone of the backend
Architecture
 Android
 UiAutomator ( Version 4.2 or +)
 Default Backend for Android
 Selendroid ( Version 2.3+)
 A separate open source project for
Android automation
 Instrumentation is the Backend
 iOS
 Apple’s UIAutomation Framework
Which Native Library for Which Platform
Automation of Android Apps
Native & Hybrid Apps
Requirements : (Java)
 JAVA IDE (Eclipse)
 Java JDK
 Maven Plugin for Eclipse
 Selenium WebDriver Dependencies/Appium
Java-Client Dependency (Maven)
 Android SDK
 Junit
 Emulator/ Real Device
 Appium Server
 Node.js (If running appium from source)
Configurations:
 Environment Variables & Path Settings
 JAVA_HOME
 ANDROID_HOME
 MAVEN_HOME
 Android Platform Version 4.2+ must be
installed
Test Script Development :
 Create a maven project in Eclipse
 Add dependency
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>1.1.0</version>
</dependency>
Test Script Development :
public void setUp() throws Exception
{
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "../../../apps/");
File app = new File(appDir, "App_Name.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","Android");
capabilities.setCapability("browserName", "");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", “package_name ");
capabilities.setCapability("appActivity", ".activity_name");
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
}
public void tearDown() throws Exception
{
driver.quit();
}
Starting Appium Server
From Source:
Install Node.js
Download Appium or Clone it using GitHub
In cmd navigate to node_modules/appium/bin
Run 'node appium [server arguments]'
From GUI Interface:
Do the configurations as needed from GUI
Click launch button to launch appium server
Appium Server Arguments
Usage : node appium [arguments](windows), appium & [arguments] (mac)
--app : To specify the path to the AUT(iOS: .app, android: apk)
-U , --udid : Unique device identifier of the connected physical device
-a, --address : IP Address to listen on
-p, --port : port to listen on
--session-override : Enables session override
--full-reset : (iOS) Delete the entire simulator folder. (Android) Reset
app state by uninstalling app instead of clearing app data. On
Android, this will also remove the app after the session is complete.
--no-reset : Don't reset app state between sessions
-l, --pre-launch : Pre-launch the application before allowing the first
session
Complete List :
https://github.com/appium/appium/blob/master/docs/en/server-args.md
Automation of Android Apps
Web Apps
Automating Web Apps
public void setUp() throws Exception
{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("deviceName","Android Emulator");
capabilities.setCapability("browserName", "Browser or Chrome");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("app", app.getAbsolutePath());
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
}
Automating Web Apps
 Download Google Chrome(30+) in PC
 Navigate to ‘chrome://inspect’
 Connect device / Start Emulator
 Open the browser in the Device/Emulator and
navigate to the URL under test
 Click on inspect button on Chrome to get the
page source and inspect elements
How to get Locators?
Automation of iOS Apps
Requirements : (Java)
 Mac OS X 10.7+
 Xcode 4.6.3+
 iOS SDKs with Command Line Tools
 JAVA IDE (Eclipse)
 Java JDK
 Maven Plugin for Eclipse
 Selenium WebDriver Dependencies
 Junit
 Simulator/ Real Device
 Appium Server
 Node.js (If running appium from source)
Configurations:
 Environment Variables & Path Settings
 JAVA_HOME
 ANDROID_HOME
 MAVEN_HOME
 iOS SDKs with Command Line Tools
 Authorize the use of Instuments
 Sudo grunt authorize (If running from source)
 An alert prompts to do so if used GUI version of
Appium
Collecting the .app build of AUT
 Compile and Run the source code of AUT in
iOS Simulators
 Navigate to Library Application Support→ →
iPhone Simulator [version] Applications→ → →
[choose_folder_which_belongs_to_compiled_pro
ject] application_name.app→
Developing Test Scripts
public void setUp() throws Exception
{
File appDir = new File(System.getProperty("user.dir"), "../../../apps/");
File app = new File(appDir, “App_Name.app");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", "");
capabilities.setCapability("platformVersion", "7.1");
capabilities.setCapability("platformName", "Mac");
capabilities.setCapability("deviceName", "iPhone Simulator");
capabilities.setCapability("app", app.getAbsolutePath());
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
public void tearDown() throws Exception
{
driver.quit();
}
Starting Appium Server
From Source:
From Terminal run the following commands
> brew install node # get node.js
> npm install -g appium # get appium
> npm install wd # get appium client
> appium & # start appium
From GUI Interface:
> Make required configurations from GUI
> Click Launch button to launch appium server
Running with Real Devices
 Specify device UDID with appium server
arguments or with the GUI version
 Compile source of AUT in debug mode
 AUT must be compiled with a Developers
Signature and a Developer Provisioning
profile(Not Distribution type)
 Device must be authorized as a development
device with xcode
 Specify Bundle ID with appium after installing
the ipa or running the AUT project directly to
device
Appium Server Capabilities
Complete List:
https://github.com/appium/appium/blob/master/docs/en/caps.md
Locating Elements
 By Class (UI component type)
E.g
UIATextField , UIAStaticText (iOS)
android.widget.Button ,
android.widget.EditText (Android)
 By Xpath (An abstract representation of certain
element with constraints)
 By Id
 Some of the Mobile JSON Wire Protocol Strategies
Accessibility ID (for iOS the accessibility identifier and for
Android the content-description)
Appium Inspector
 Inspect Elements and the element hierarchy with a
GUI interface
 Inspect the associated attributes of an element
 Easily identify the Xpath for all the elements
 Find the enable/disable status of an element
 Record test scripts and export in the desired language
 Verify mobile commands from Inspector before
implementation
Android & iOS Automation Using Appium
Android & iOS Automation Using Appium
www.mindfiresolutions.com
https://www.facebook.com/MindfireSolutions
http://www.linkedin.com/company/mindfire-solutions
http://twitter.com/mindfires
References
 appium.io
 github.com/appium/appium
1 sur 36

Recommandé

Getting started with appium par
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
616 vues41 diapositives
Appium basics par
Appium basicsAppium basics
Appium basicsSyam Sasi
668 vues39 diapositives
Mobile Automation with Appium par
Mobile Automation with AppiumMobile Automation with Appium
Mobile Automation with AppiumManoj Kumar Kumar
2.8K vues43 diapositives
Automation Testing With Appium par
Automation Testing With AppiumAutomation Testing With Appium
Automation Testing With AppiumKnoldus Inc.
5.2K vues19 diapositives
Appium Presentation par
Appium Presentation Appium Presentation
Appium Presentation OmarUsman6
1K vues24 diapositives
Appium ppt par
Appium pptAppium ppt
Appium pptnatashasweety7
1.8K vues11 diapositives

Contenu connexe

Tendances

Mobile Test Automation - Appium par
Mobile Test Automation - AppiumMobile Test Automation - Appium
Mobile Test Automation - AppiumMaria Machlowska
2.8K vues26 diapositives
Appium par
AppiumAppium
AppiumKeshav Kashyap
4.6K vues21 diapositives
Automation With Appium par
Automation With AppiumAutomation With Appium
Automation With AppiumKnoldus Inc.
481 vues15 diapositives
Appium par
AppiumAppium
AppiumDeepshikha Singh
763 vues29 diapositives
Mobile Application Testing par
Mobile Application TestingMobile Application Testing
Mobile Application TestingRamakrishna Telapolu
8.1K vues25 diapositives
Mobile Application Testing par
Mobile Application TestingMobile Application Testing
Mobile Application TestingNoor Orfahly
1.2K vues36 diapositives

Tendances(20)

Mobile Application Testing par Noor Orfahly
Mobile Application TestingMobile Application Testing
Mobile Application Testing
Noor Orfahly1.2K vues
Appium Architecture | How Appium Works | Edureka par Edureka!
Appium Architecture | How Appium Works | EdurekaAppium Architecture | How Appium Works | Edureka
Appium Architecture | How Appium Works | Edureka
Edureka!306 vues
Mobile application testing par Softheme
Mobile application testingMobile application testing
Mobile application testing
Softheme10.9K vues
Mobile application testing par vodQA
Mobile application testingMobile application testing
Mobile application testing
vodQA2.9K vues
Automation testing on ios platform using appium par Ambreen Khan
Automation testing on ios platform using appiumAutomation testing on ios platform using appium
Automation testing on ios platform using appium
Ambreen Khan9K vues
Android ppt par Ansh Singh
Android pptAndroid ppt
Android ppt
Ansh Singh63.5K vues
Mobile Application Testing by Javed Ansari par Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed Ansari
Javed Ansari4.5K vues
Mobile automation using Appium par Saroj Singh
Mobile automation using AppiumMobile automation using Appium
Mobile automation using Appium
Saroj Singh70 vues
Mobile Application Testing par SWAAM Tech
Mobile Application TestingMobile Application Testing
Mobile Application Testing
SWAAM Tech24.5K vues
Introduction to Android and Android Studio par Suyash Srijan
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan25.1K vues
Mobile Application Testing Training Presentation par MobiGnosis
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
MobiGnosis7.3K vues
Mobile Application Testing Strategy par ankitQA
Mobile Application Testing StrategyMobile Application Testing Strategy
Mobile Application Testing Strategy
ankitQA2K vues
What is Appium? Edureka par Edureka!
What is Appium? EdurekaWhat is Appium? Edureka
What is Appium? Edureka
Edureka!211 vues

Similaire à Android & iOS Automation Using Appium

Android CI and Appium par
Android CI and AppiumAndroid CI and Appium
Android CI and AppiumOren Ashkenazy
801 vues22 diapositives
Next level of Appium par
Next level of AppiumNext level of Appium
Next level of AppiumKeshav Kashyap
2.8K vues23 diapositives
Android UI Testing with Appium par
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
10.9K vues25 diapositives
Appium solution par
Appium solutionAppium solution
Appium solutionNael Abd Eljawad
1.3K vues62 diapositives
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени... par
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QAFest
1.6K vues26 diapositives
Appium understanding document par
Appium understanding documentAppium understanding document
Appium understanding documentAkshay Pillay
250 vues5 diapositives

Similaire à Android & iOS Automation Using Appium(20)

Android UI Testing with Appium par Luke Maung
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
Luke Maung10.9K vues
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени... par QAFest
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QAFest1.6K vues
Appium understanding document par Akshay Pillay
Appium understanding documentAppium understanding document
Appium understanding document
Akshay Pillay250 vues
Deploying applications to Cloud with Google App Engine par Alexander Zamkovyi
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App Engine
Alexander Zamkovyi1.4K vues
Apache Cordova In Action par Hazem Saleh
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
Hazem Saleh3.1K vues
eXo Platform SEA - Play Framework Introduction par vstorm83
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83954 vues
Selenium, Appium, and Robots! par hugs
Selenium, Appium, and Robots!Selenium, Appium, and Robots!
Selenium, Appium, and Robots!
hugs35K vues
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova par Hazem Saleh
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
Hazem Saleh1.7K vues
Comprehensive List of Open Source QA Tools par Ashish Bansal
Comprehensive List of Open Source QA ToolsComprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA Tools
Ashish Bansal370 vues
Meteor Meet-up San Diego December 2014 par Lou Sacco
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
Lou Sacco730 vues
WebAPIs & Apps - Mozilla London par Robert Nyman
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman30.7K vues
Mobile Quality Night Vienna 2015 - Testobject Appium in der Cloud par Rudolf Grötz
Mobile Quality Night Vienna 2015 - Testobject Appium in der CloudMobile Quality Night Vienna 2015 - Testobject Appium in der Cloud
Mobile Quality Night Vienna 2015 - Testobject Appium in der Cloud
Rudolf Grötz529 vues
Introduction to Apache Cordova (Phonegap) par ejlp12
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
ejlp1232.4K vues

Plus de Mindfire Solutions

Physician Search and Review par
Physician Search and ReviewPhysician Search and Review
Physician Search and ReviewMindfire Solutions
530 vues10 diapositives
diet management app par
diet management appdiet management app
diet management appMindfire Solutions
343 vues10 diapositives
Business Technology Solution par
Business Technology SolutionBusiness Technology Solution
Business Technology SolutionMindfire Solutions
368 vues11 diapositives
Remote Health Monitoring par
Remote Health MonitoringRemote Health Monitoring
Remote Health MonitoringMindfire Solutions
226 vues11 diapositives
Influencer Marketing Solution par
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing SolutionMindfire Solutions
191 vues10 diapositives
ELMAH par
ELMAHELMAH
ELMAHMindfire Solutions
1.2K vues15 diapositives

Plus de Mindfire Solutions(20)

Dernier

DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... par
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...Deltares
6 vues28 diapositives
Winter '24 Release Chat.pdf par
Winter '24 Release Chat.pdfWinter '24 Release Chat.pdf
Winter '24 Release Chat.pdfmelbourneauuser
9 vues20 diapositives
SAP FOR CONTRACT MANUFACTURING.pdf par
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
11 vues2 diapositives
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM... par
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...Deltares
7 vues40 diapositives
HarshithAkkapelli_Presentation.pdf par
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
11 vues16 diapositives
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... par
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...Deltares
6 vues22 diapositives

Dernier(20)

DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... par Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares6 vues
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM... par Deltares
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
DSD-INT 2023 Next-Generation Flood Inundation Mapping for Taiwan - Delft3D FM...
Deltares7 vues
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... par Deltares
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
Deltares6 vues
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge... par Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
Deltares16 vues
360 graden fabriek par info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info3349224 vues
Navigating container technology for enhanced security by Niklas Saari par Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy8 vues
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs par Deltares
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
Deltares7 vues
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... par Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares9 vues
Software testing company in India.pptx par SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 vues
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... par Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri711 vues
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... par Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 vues
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema par Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 vues
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... par Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares11 vues
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... par Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 vues
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols par Deltares
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
Deltares7 vues

Android & iOS Automation Using Appium

  • 1. Android & iOS automation using Appium Pre se nte r : Abhishe k Swain, Mindfire So lutio ns
  • 2. About Me: Abhishek Swain, Software QA Engineer Mindfire Solutions Skills : Robotium , Appium , Selenium WebDriver , Maven , Junit , SQL .... Certifications : ISTQB Foundation Level, V-Skills Selenium Certified Connect Me : Facebook : http://www.facebook.com/jikun55 LinkedIn : http://in.linkedin.com/pub/abhishek-swain/58/8a/829/ Contact Me : Email : abhishek.swain@mindfiresolutions.com /mfsi.abhishek@gmail.com Skype: mfsi_abhishekswain
  • 3. Agenda  Introduction  Features List  Current Limitations  Understanding Architecture  Automating Android Apps  Native/ Hybrid app  Mobile Web app  Automating iOS Apps  Prerequisites and configurations  On Simulators  On Real iDevices  Short Demo  Questions & Answers
  • 4. Introduction Appium is an Open source , Cross Platform test automation tool for mobile apps Hosted with GitHub  Maintained by Dan Cuellar, Jonathan Lipps and a number of other contributors Supports automation of Native , Hybrid and Mobile Web apps Based on WebDriver JSON wire protocol Based on Client-Server Architecture Appium Server written in Node.js
  • 5. Features Automation support for  iOS Mobile  Android  Firefox mobile OS Cross-Platform
  • 6. Features Automation support for  Native App  Hybrid App  Mobile Web App Application Types
  • 7. Features  Supports all the WebDriver Client Libraries  Java  Ruby  Python  JavaScript  PHP  C# Multiple Client Libraries
  • 8. Features  Common Library for all the mobile platforms e.g. Android , iOS  Selenium WebDriver Interfaces implemented  Added mobile specific functions e.g. driver.pinch(), driver.zoom(), driver.currentActivity(), driver.lock() etc.  Common API for both Native and Web components Common API
  • 9. Features  Android  Real Devices  Emulators  Native Browser  Mobile Chrome  iOS  Real iDevices (e.g. iPhone, iPad etc.)  Simulators  Mobile Safari Test Modalities
  • 10. Limitations  Android  No Support for Toast messages  Android Version 4.2+ required  iOS  Needs mac OSX 10.7+, lower versions not supported
  • 11. Architecture  Client Server Architecture  Based on WebDriver JSON Wire Protocol  Native test libraries of respective platform is the backbone of the backend
  • 12. Architecture  Android  UiAutomator ( Version 4.2 or +)  Default Backend for Android  Selendroid ( Version 2.3+)  A separate open source project for Android automation  Instrumentation is the Backend  iOS  Apple’s UIAutomation Framework Which Native Library for Which Platform
  • 13. Automation of Android Apps Native & Hybrid Apps
  • 14. Requirements : (Java)  JAVA IDE (Eclipse)  Java JDK  Maven Plugin for Eclipse  Selenium WebDriver Dependencies/Appium Java-Client Dependency (Maven)  Android SDK  Junit  Emulator/ Real Device  Appium Server  Node.js (If running appium from source)
  • 15. Configurations:  Environment Variables & Path Settings  JAVA_HOME  ANDROID_HOME  MAVEN_HOME  Android Platform Version 4.2+ must be installed
  • 16. Test Script Development :  Create a maven project in Eclipse  Add dependency <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>1.1.0</version> </dependency>
  • 17. Test Script Development : public void setUp() throws Exception { File classpathRoot = new File(System.getProperty("user.dir")); File appDir = new File(classpathRoot, "../../../apps/"); File app = new File(appDir, "App_Name.apk"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName","Android"); capabilities.setCapability("browserName", ""); capabilities.setCapability("platformVersion", "4.4"); capabilities.setCapability("app", app.getAbsolutePath()); capabilities.setCapability("appPackage", “package_name "); capabilities.setCapability("appActivity", ".activity_name"); driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); } public void tearDown() throws Exception { driver.quit(); }
  • 18. Starting Appium Server From Source: Install Node.js Download Appium or Clone it using GitHub In cmd navigate to node_modules/appium/bin Run 'node appium [server arguments]' From GUI Interface: Do the configurations as needed from GUI Click launch button to launch appium server
  • 19. Appium Server Arguments Usage : node appium [arguments](windows), appium & [arguments] (mac) --app : To specify the path to the AUT(iOS: .app, android: apk) -U , --udid : Unique device identifier of the connected physical device -a, --address : IP Address to listen on -p, --port : port to listen on --session-override : Enables session override --full-reset : (iOS) Delete the entire simulator folder. (Android) Reset app state by uninstalling app instead of clearing app data. On Android, this will also remove the app after the session is complete. --no-reset : Don't reset app state between sessions -l, --pre-launch : Pre-launch the application before allowing the first session Complete List : https://github.com/appium/appium/blob/master/docs/en/server-args.md
  • 20. Automation of Android Apps Web Apps
  • 21. Automating Web Apps public void setUp() throws Exception { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("platformVersion", "4.4"); capabilities.setCapability("platformName","Android"); capabilities.setCapability("deviceName","Android Emulator"); capabilities.setCapability("browserName", "Browser or Chrome"); capabilities.setCapability("platformVersion", "4.4"); capabilities.setCapability("app", app.getAbsolutePath()); driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); }
  • 22. Automating Web Apps  Download Google Chrome(30+) in PC  Navigate to ‘chrome://inspect’  Connect device / Start Emulator  Open the browser in the Device/Emulator and navigate to the URL under test  Click on inspect button on Chrome to get the page source and inspect elements How to get Locators?
  • 24. Requirements : (Java)  Mac OS X 10.7+  Xcode 4.6.3+  iOS SDKs with Command Line Tools  JAVA IDE (Eclipse)  Java JDK  Maven Plugin for Eclipse  Selenium WebDriver Dependencies  Junit  Simulator/ Real Device  Appium Server  Node.js (If running appium from source)
  • 25. Configurations:  Environment Variables & Path Settings  JAVA_HOME  ANDROID_HOME  MAVEN_HOME  iOS SDKs with Command Line Tools  Authorize the use of Instuments  Sudo grunt authorize (If running from source)  An alert prompts to do so if used GUI version of Appium
  • 26. Collecting the .app build of AUT  Compile and Run the source code of AUT in iOS Simulators  Navigate to Library Application Support→ → iPhone Simulator [version] Applications→ → → [choose_folder_which_belongs_to_compiled_pro ject] application_name.app→
  • 27. Developing Test Scripts public void setUp() throws Exception { File appDir = new File(System.getProperty("user.dir"), "../../../apps/"); File app = new File(appDir, “App_Name.app"); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("browserName", ""); capabilities.setCapability("platformVersion", "7.1"); capabilities.setCapability("platformName", "Mac"); capabilities.setCapability("deviceName", "iPhone Simulator"); capabilities.setCapability("app", app.getAbsolutePath()); driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); } public void tearDown() throws Exception { driver.quit(); }
  • 28. Starting Appium Server From Source: From Terminal run the following commands > brew install node # get node.js > npm install -g appium # get appium > npm install wd # get appium client > appium & # start appium From GUI Interface: > Make required configurations from GUI > Click Launch button to launch appium server
  • 29. Running with Real Devices  Specify device UDID with appium server arguments or with the GUI version  Compile source of AUT in debug mode  AUT must be compiled with a Developers Signature and a Developer Provisioning profile(Not Distribution type)  Device must be authorized as a development device with xcode  Specify Bundle ID with appium after installing the ipa or running the AUT project directly to device
  • 30. Appium Server Capabilities Complete List: https://github.com/appium/appium/blob/master/docs/en/caps.md
  • 31. Locating Elements  By Class (UI component type) E.g UIATextField , UIAStaticText (iOS) android.widget.Button , android.widget.EditText (Android)  By Xpath (An abstract representation of certain element with constraints)  By Id  Some of the Mobile JSON Wire Protocol Strategies Accessibility ID (for iOS the accessibility identifier and for Android the content-description)
  • 32. Appium Inspector  Inspect Elements and the element hierarchy with a GUI interface  Inspect the associated attributes of an element  Easily identify the Xpath for all the elements  Find the enable/disable status of an element  Record test scripts and export in the desired language  Verify mobile commands from Inspector before implementation