SlideShare a Scribd company logo
1 of 37
Android
Automation
Testing with
Selendroid
Agenda
 Testing?
 Mobile Testing
 Types & challenges
 Selenium
 IDE
 RC
 Webdriver
 Grid
 Webdriver Demo
 Selendroid
 Selendroid Architecture
 Selendroid standalone & server
 Selendroid Capabilities & Inspector
 Selendroid Demo
Testing
• A process of demonstrating that errors are not
present ?
OR
• A way of establishing confidence that a program
does what it is supposed to do ?
OR
• A means of achieving an error-free program by
finding all errors ?
A “DESTRUCTIVE”, yet creative process
Testing
Requirements
Capture
Analysis
Test planning &
Scenario Design
Test Case
Development
Test Execution
Test Result
Analysis
Test Cycle
Closure
Defect Fixing
Cycle
Defects
New Version
The Scenarios Design and the Test Case
Development could normally start in
parallel with the Development Cycle.
Test Execution Synchs up with the
Development Cycle during the functional
Testing Phases
Mobile Testing
Mobile Testing - Types
 UI testing
 Functional testing
 Interrupt testing
Internal interrupts
External interrupts
 Device specific testing
 Performance testing
 Security testing
 Compatibility testing
 Localization and i18n testing
 Automation testing
 Network testing
 Sound testing
Mobile Testing – Challenges
 Devices – The biggest Mobile Testing challenge
 Diversity of the Mobile OSs and there flavors
 Diversity in Hardware Configuration
 Network related challenges
 Competitive market
 Change in market trend
Automation & Frameworks
 Why Automation?
 Frameworks –
Test Script Modularity
• This can be achieved by creating small, independent scripts that
represent modules, sections, and functions of the application-under-test
and later can be combined in a hierarchical fashion to construct larger
tests.
Test Library Architecture
• The test library architecture framework is very similar to the test script
modularity framework but it divides the AUT into procedures and
functions or objects and methods instead of scripts.
Data-Driven Test Automation Framework
• A data-driven framework is where test input and output values are read
from data files (ODBC sources, CVS files, Excel files, ADO objects, and
such) and are loaded into variables in captured or manually coded
scripts.
Automation & Frameworks
Keyword-Driven Test Automation Framework
 This requires the development of data tables and
keywords, independent of the test automation tool used
to execute them and the test script code that "drives"
the AUT and the data.
Hybrid Test Automation Framework
The most commonly implemented framework is a
combination of all of the above techniques, pulling from
their strengths and trying to mitigate their weaknesses.
The most successful automation frameworks generally
accommodate both Keyword-Driven testing as well as
Data-Driven scripts.
This allows data driven scripts to take advantage of the
powerful libraries and utilities that usually accompany a
keyword driven architecture.
The framework utilities can make the data driven
scripts more compact and less prone to failure than they
otherwise would have been.
Introduction To selenium
 What is selenium?
 Selenium is a suite of tools to automate web browsers across many platforms.
 Portable software testing framework for web apps.
 Test can be written in Java, C#, Groovy, Perl, PHP, Python and Ruby.
 Tests can be executed on all modern browsers
 Platform Independent
 Open source software
 Latest release v2.44 (as on 23rd Oct 2014)
 Selenium extended to selendroid and ios-driver to automate mobile
applications
Selenium Components
1. Selenium IDE
2. Selenium 1.0 – Remote Control
3. Selenium 2.0 – WebDriver
4. Selenium Grid
1. Selenium IDE
 Helps you to develop Selenium test cases
 Easy to use firefox plug-in
 Supports record and playback
 Command , Target & Value
 Test Cases & test suites saved in “html” format
 Tests can be exported in other formats like java, C# , php
etc using formatters.
1. Selenium IDE – Test Case
Selenium IDE – Export Test Case
Java / Junit 4 / Webdriver tests
2. Remote Control
 Selenium Remote Control (RC) is a test tool that allows
you to write automated web application UI tests in any
programming language against any HTTP website using
any mainstream JavaScript-enabled browser.
 Selenium RC comes in two parts.
 A server which automatically launches and kills browsers,
and acts as a HTTP proxy for web requests from them.
 Client libraries for your favorite computer language.
Selenium RC Architecture
3. WebDriver
 Driving a browser natively as a user would either locally
or on a remote machine using the Selenium Server
 Selenium 1.0 + WebDriver = Selenium 2.0
 WebDriver is designed in a simpler and more concise
programming interface along with addressing some
limitations in the Selenium-RC API.
4. Selenium Grid
 Selenium-Grid allows you run your tests on different
machines against different browsers in parallel.
 That is, running multiple tests at the same time against
different machines running different browsers and
operating systems.
 Selenium-Grid support distributed test execution. It
allows for running your tests in a distributed test
execution environment.
4. Grid Architecture
Introduction To Selendroid
 Selendroid is a test automation framework which drives off the UI of
Android native and hybrid applications (apps) and the mobile web.
 Tests are written using the Selenium 2 client API - that's it!
 Selendroid can be used on emulators and real devices and can be
integrated as a node into the Selenium Grid for scaling and parallel
testing.
Features of Selendroid
 Full compatibility with the JSON Wire Protocol/Selenium 3 Ready.
 No modification of app under test required in order to automate it
 Testing the mobile web using built in Android driver webview app
 Same concept for automating native or hybrid apps
 UI elements can be found by different locator types
 Gestures are supported: Advanced User Interactions API
 Selendroid can interact with multiple Android devices (emulators or
hardware devices) at the same time
 Existing Emulators are started automatically
 Full integration as a node into Selenium Grid for scaling and parallel
testing
 Multiple Android target API support (10 to 19)
 Built in Inspector to simplify test case development.
 Selendroid can be extended at runtime with your own extensions !
Getting Started with
Selendroid
 System Requirements
 Mac / Linux / Windows
 Java SDK (min 1.6)
 Set JAVA_HOME
 Latest Android-SDK
 http://developer.android.com/sdk/index.html
 Set ANDROID_HOME
 Android Virtual Device or Android Hardware Device
 Selendroid standalone server
Selendroid Architecture
Major Components
 Selendroid-Client - the java client library (based on the selenium java client).
 Selendroid-Server - that is running beside your app on the Android device.
 AndroidDriver-App - a built in Android driver webview app to test the mobile web.
 Selendroid-Standalone - manages different Android devices by installing the selendroid-
server and the app under test.
Selendroid-Server
 Selendroid-server is the main component responsible for
the app automation.
 The central driver class is DefaultSelendroidDriver. This
class is responsible for doing the common activities (like
taking screenshots) for both contexts NATIVE_APP and
WEBVIEW
 The web view related driver class is
SelendroidWebDriver and native class is
SelendroidNativeDriver.
Selendroid-Standalone
 Central driver class is SelendroidStandaloneDriver that
acts as a proxy between the selendroid-client and the
selendroid-server
 Starts an Android emulator,
 creates for the app under test a customized selendroid-
server and
 installs everything on the device. After the session is
initialized on the device,
 subsequent requests are directly forwarded to the server
on the device and the response routed back to the
client.
Getting an AUT ready for
automation
 Selendroid can be used to test already build apps. (.apk)
 The .apk file must be existing on machine where
selendroid-standalone server will be stared.
 customized selendroid-server for the app under test
(AUT) will be created
 Both apps (selendroid-server and AUT) must be signed
with the same certificate in order to install the apks on
the device
Launching Selendroid
 Java –jar <<selendroidstandalone.jar>> –app <<myApp.apk>>
 java
-jar selendroid-standalone-0.12.0-with-
dependencies.jar
-app selendroid-test-app-0.12.0.apk
 Selendroid-standalone will start a http server on port 4444
 It will scan all AVDs that the user has created.
 The Android target version and the screen size will be identified.
 If an emulator is running, it can be used
 If there are Android hardware devices plugged in, they will also be
added to the device store.
 Check application status on :
http://localhost:4444/wd/hub/status.
First Tests
 In order to create a new test session in the desired
capabilities, the appId of the app under test must be
provided in the format: io.selendroid.testapp:0.12.0.
 Based on that information a matching Android device will be
identified, otherwise the test session will throw an error and
not start
 After the found device has been initialized, a customized
selendroid-server will be created and automatically
installed on the device.
 The app under test will also be installed and the selendroid-
server on the device will then be automatically started.
 After the test session has been successfully initialized, the
test commands such as 'find an element' and 'element
interactions' are routed to this device. If the test session has
ended, the emulator will stop automatically
Desired Capabilities
(SelendroidCapabilities)
 Mandatory properties
 new SelendroidCapabilities( ... ):
 This requests an app for the test session without any
preference about emulator or hardware device.
 SelendroidCapabilities.emulator( ... ):
 This requests an emulator and will fail the test session if
no emulator is available.
 SelendroidCapabilities.device( ... )
 This requests a hardware device and will fail the test
session if no device is plugged in.
 SelendroidCapabilities.android( ... )
 This starts a mobile web testing session.
Desired Capabilities
(SelendroidCapabilities)
 For testing native or hybrid apps:
 aut
 Specify the app id of the app under test (aut). E.g.
io.selendroid.testapp:0.12.0
 For testing Mobile Web:
 browserName
 Value must be android to start the 'Android driver webview
app'.
Desired Capabilities
(SelendroidCapabilities)
Optional Properties
 emulator
 If True, an emulator will be requested. If False, a hardware
device will be requested.
 platformVersion
 Specify the Android target API version of the device. E.g.
for KitKat it is: 19
 locale
 Specify the locale of an emulator to be used in the test
session. During the start the locale will be automatically
configured. E.g. de_CH
Desired Capabilities
(SelendroidCapabilities)
Optional Properties
 screenSize
 Specify the screen size of the device: e.g. 720x1280
 display
 Specify the display number that is used to start the
emulator on. Supported only in Linux platforms. E.g. 1
 preSessionAdbCommands
 Specify a list of adb commands that will be executed on the
target device before selendroid-server will be started. E.g.
shell setprop name selendroid,
Selendroid Inspector
Selendroid Inspector
 It helps to inspect current state of app’s UI.
 http://localhost:4444/inspector
 Features
 View hierarchy
 View UI element properties
 UI screenshot with view locator
 Record the click actions
 Display the source html of a web view
 XPath helper
Thank You …
 By Vikas Thange
(Automation Testing consultant)
vikasthange@gmail.com

More Related Content

What's hot

What's hot (20)

Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Introduction to Robot Framework – Exove
Introduction to Robot Framework – ExoveIntroduction to Robot Framework – Exove
Introduction to Robot Framework – Exove
 
Test Automation and Selenium
Test Automation and SeleniumTest Automation and Selenium
Test Automation and Selenium
 
Appium: Automation for Mobile Apps
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile Apps
 
test_automation_POC
test_automation_POCtest_automation_POC
test_automation_POC
 
Selenium
SeleniumSelenium
Selenium
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium Demo
Selenium DemoSelenium Demo
Selenium Demo
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Appium ppt
Appium pptAppium ppt
Appium ppt
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Automation With Appium
Automation With AppiumAutomation With Appium
Automation With Appium
 
Test Automation Using Python | Edureka
Test Automation Using Python | EdurekaTest Automation Using Python | Edureka
Test Automation Using Python | Edureka
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 

Similar to Android Automation Testing with Selendroid

Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
Nikhil Kapoor
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Simplilearn
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 

Similar to Android Automation Testing with Selendroid (20)

Mobile DevTest Dictionary
Mobile DevTest DictionaryMobile DevTest Dictionary
Mobile DevTest Dictionary
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
test-automation-selenium-160216124839.pptx
test-automation-selenium-160216124839.pptxtest-automation-selenium-160216124839.pptx
test-automation-selenium-160216124839.pptx
 
Test automationslides
Test automationslidesTest automationslides
Test automationslides
 
Python selenium
Python seleniumPython selenium
Python selenium
 
ATAGTR2017 Appium
ATAGTR2017 AppiumATAGTR2017 Appium
ATAGTR2017 Appium
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
A Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software TestingA Simple Guide to Selenium Software Testing
A Simple Guide to Selenium Software Testing
 
Learn Selenium - Online Guide
Learn Selenium - Online GuideLearn Selenium - Online Guide
Learn Selenium - Online Guide
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium PPT 2.pptx
Selenium PPT 2.pptxSelenium PPT 2.pptx
Selenium PPT 2.pptx
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
Mobility testing
Mobility testingMobility testing
Mobility testing
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
 
Selenium
SeleniumSelenium
Selenium
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Selenium
SeleniumSelenium
Selenium
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Appium.pptx
Appium.pptxAppium.pptx
Appium.pptx
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Android Automation Testing with Selendroid

  • 2. Agenda  Testing?  Mobile Testing  Types & challenges  Selenium  IDE  RC  Webdriver  Grid  Webdriver Demo  Selendroid  Selendroid Architecture  Selendroid standalone & server  Selendroid Capabilities & Inspector  Selendroid Demo
  • 3. Testing • A process of demonstrating that errors are not present ? OR • A way of establishing confidence that a program does what it is supposed to do ? OR • A means of achieving an error-free program by finding all errors ? A “DESTRUCTIVE”, yet creative process
  • 4. Testing Requirements Capture Analysis Test planning & Scenario Design Test Case Development Test Execution Test Result Analysis Test Cycle Closure Defect Fixing Cycle Defects New Version The Scenarios Design and the Test Case Development could normally start in parallel with the Development Cycle. Test Execution Synchs up with the Development Cycle during the functional Testing Phases
  • 6. Mobile Testing - Types  UI testing  Functional testing  Interrupt testing Internal interrupts External interrupts  Device specific testing  Performance testing  Security testing  Compatibility testing  Localization and i18n testing  Automation testing  Network testing  Sound testing
  • 7. Mobile Testing – Challenges  Devices – The biggest Mobile Testing challenge  Diversity of the Mobile OSs and there flavors  Diversity in Hardware Configuration  Network related challenges  Competitive market  Change in market trend
  • 8. Automation & Frameworks  Why Automation?  Frameworks – Test Script Modularity • This can be achieved by creating small, independent scripts that represent modules, sections, and functions of the application-under-test and later can be combined in a hierarchical fashion to construct larger tests. Test Library Architecture • The test library architecture framework is very similar to the test script modularity framework but it divides the AUT into procedures and functions or objects and methods instead of scripts. Data-Driven Test Automation Framework • A data-driven framework is where test input and output values are read from data files (ODBC sources, CVS files, Excel files, ADO objects, and such) and are loaded into variables in captured or manually coded scripts.
  • 9. Automation & Frameworks Keyword-Driven Test Automation Framework  This requires the development of data tables and keywords, independent of the test automation tool used to execute them and the test script code that "drives" the AUT and the data. Hybrid Test Automation Framework The most commonly implemented framework is a combination of all of the above techniques, pulling from their strengths and trying to mitigate their weaknesses. The most successful automation frameworks generally accommodate both Keyword-Driven testing as well as Data-Driven scripts. This allows data driven scripts to take advantage of the powerful libraries and utilities that usually accompany a keyword driven architecture. The framework utilities can make the data driven scripts more compact and less prone to failure than they otherwise would have been.
  • 10. Introduction To selenium  What is selenium?  Selenium is a suite of tools to automate web browsers across many platforms.  Portable software testing framework for web apps.  Test can be written in Java, C#, Groovy, Perl, PHP, Python and Ruby.  Tests can be executed on all modern browsers  Platform Independent  Open source software  Latest release v2.44 (as on 23rd Oct 2014)  Selenium extended to selendroid and ios-driver to automate mobile applications
  • 11. Selenium Components 1. Selenium IDE 2. Selenium 1.0 – Remote Control 3. Selenium 2.0 – WebDriver 4. Selenium Grid
  • 12. 1. Selenium IDE  Helps you to develop Selenium test cases  Easy to use firefox plug-in  Supports record and playback  Command , Target & Value  Test Cases & test suites saved in “html” format  Tests can be exported in other formats like java, C# , php etc using formatters.
  • 13.
  • 14. 1. Selenium IDE – Test Case
  • 15. Selenium IDE – Export Test Case
  • 16. Java / Junit 4 / Webdriver tests
  • 17. 2. Remote Control  Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.  Selenium RC comes in two parts.  A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them.  Client libraries for your favorite computer language.
  • 19. 3. WebDriver  Driving a browser natively as a user would either locally or on a remote machine using the Selenium Server  Selenium 1.0 + WebDriver = Selenium 2.0  WebDriver is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC API.
  • 20. 4. Selenium Grid  Selenium-Grid allows you run your tests on different machines against different browsers in parallel.  That is, running multiple tests at the same time against different machines running different browsers and operating systems.  Selenium-Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.
  • 22. Introduction To Selendroid  Selendroid is a test automation framework which drives off the UI of Android native and hybrid applications (apps) and the mobile web.  Tests are written using the Selenium 2 client API - that's it!  Selendroid can be used on emulators and real devices and can be integrated as a node into the Selenium Grid for scaling and parallel testing.
  • 23. Features of Selendroid  Full compatibility with the JSON Wire Protocol/Selenium 3 Ready.  No modification of app under test required in order to automate it  Testing the mobile web using built in Android driver webview app  Same concept for automating native or hybrid apps  UI elements can be found by different locator types  Gestures are supported: Advanced User Interactions API  Selendroid can interact with multiple Android devices (emulators or hardware devices) at the same time  Existing Emulators are started automatically  Full integration as a node into Selenium Grid for scaling and parallel testing  Multiple Android target API support (10 to 19)  Built in Inspector to simplify test case development.  Selendroid can be extended at runtime with your own extensions !
  • 24. Getting Started with Selendroid  System Requirements  Mac / Linux / Windows  Java SDK (min 1.6)  Set JAVA_HOME  Latest Android-SDK  http://developer.android.com/sdk/index.html  Set ANDROID_HOME  Android Virtual Device or Android Hardware Device  Selendroid standalone server
  • 25. Selendroid Architecture Major Components  Selendroid-Client - the java client library (based on the selenium java client).  Selendroid-Server - that is running beside your app on the Android device.  AndroidDriver-App - a built in Android driver webview app to test the mobile web.  Selendroid-Standalone - manages different Android devices by installing the selendroid- server and the app under test.
  • 26. Selendroid-Server  Selendroid-server is the main component responsible for the app automation.  The central driver class is DefaultSelendroidDriver. This class is responsible for doing the common activities (like taking screenshots) for both contexts NATIVE_APP and WEBVIEW  The web view related driver class is SelendroidWebDriver and native class is SelendroidNativeDriver.
  • 27. Selendroid-Standalone  Central driver class is SelendroidStandaloneDriver that acts as a proxy between the selendroid-client and the selendroid-server  Starts an Android emulator,  creates for the app under test a customized selendroid- server and  installs everything on the device. After the session is initialized on the device,  subsequent requests are directly forwarded to the server on the device and the response routed back to the client.
  • 28. Getting an AUT ready for automation  Selendroid can be used to test already build apps. (.apk)  The .apk file must be existing on machine where selendroid-standalone server will be stared.  customized selendroid-server for the app under test (AUT) will be created  Both apps (selendroid-server and AUT) must be signed with the same certificate in order to install the apks on the device
  • 29. Launching Selendroid  Java –jar <<selendroidstandalone.jar>> –app <<myApp.apk>>  java -jar selendroid-standalone-0.12.0-with- dependencies.jar -app selendroid-test-app-0.12.0.apk  Selendroid-standalone will start a http server on port 4444  It will scan all AVDs that the user has created.  The Android target version and the screen size will be identified.  If an emulator is running, it can be used  If there are Android hardware devices plugged in, they will also be added to the device store.  Check application status on : http://localhost:4444/wd/hub/status.
  • 30. First Tests  In order to create a new test session in the desired capabilities, the appId of the app under test must be provided in the format: io.selendroid.testapp:0.12.0.  Based on that information a matching Android device will be identified, otherwise the test session will throw an error and not start  After the found device has been initialized, a customized selendroid-server will be created and automatically installed on the device.  The app under test will also be installed and the selendroid- server on the device will then be automatically started.  After the test session has been successfully initialized, the test commands such as 'find an element' and 'element interactions' are routed to this device. If the test session has ended, the emulator will stop automatically
  • 31. Desired Capabilities (SelendroidCapabilities)  Mandatory properties  new SelendroidCapabilities( ... ):  This requests an app for the test session without any preference about emulator or hardware device.  SelendroidCapabilities.emulator( ... ):  This requests an emulator and will fail the test session if no emulator is available.  SelendroidCapabilities.device( ... )  This requests a hardware device and will fail the test session if no device is plugged in.  SelendroidCapabilities.android( ... )  This starts a mobile web testing session.
  • 32. Desired Capabilities (SelendroidCapabilities)  For testing native or hybrid apps:  aut  Specify the app id of the app under test (aut). E.g. io.selendroid.testapp:0.12.0  For testing Mobile Web:  browserName  Value must be android to start the 'Android driver webview app'.
  • 33. Desired Capabilities (SelendroidCapabilities) Optional Properties  emulator  If True, an emulator will be requested. If False, a hardware device will be requested.  platformVersion  Specify the Android target API version of the device. E.g. for KitKat it is: 19  locale  Specify the locale of an emulator to be used in the test session. During the start the locale will be automatically configured. E.g. de_CH
  • 34. Desired Capabilities (SelendroidCapabilities) Optional Properties  screenSize  Specify the screen size of the device: e.g. 720x1280  display  Specify the display number that is used to start the emulator on. Supported only in Linux platforms. E.g. 1  preSessionAdbCommands  Specify a list of adb commands that will be executed on the target device before selendroid-server will be started. E.g. shell setprop name selendroid,
  • 36. Selendroid Inspector  It helps to inspect current state of app’s UI.  http://localhost:4444/inspector  Features  View hierarchy  View UI element properties  UI screenshot with view locator  Record the click actions  Display the source html of a web view  XPath helper
  • 37. Thank You …  By Vikas Thange (Automation Testing consultant) vikasthange@gmail.com

Editor's Notes

  1. http://docs.seleniumhq.org/projects/remote-control/
  2. http://www.guru99.com/introduction-to-selenium-grid.html
  3. http://selendroid.io/setup.html
  4. http://selendroid.io/setup.html
  5. http://selendroid.io/setup.html
  6. http://selendroid.io/setup.html
  7. http://selendroid.io/setup.html
  8. http://selendroid.io/setup.html