SlideShare a Scribd company logo
March 2018
Selenium to Appium
how hard can it be?
Sergio Neves Barros
QA Technical Architect
March 2018
1. About us
2. Selenium overview
3. Historical challenges
4. Platform overviews
5. Additional endpoints
6. Future of (mobile) web testing
Overview
March 2018
About us
Myself:
● 15 years of testing experience
● Insurance, Banking and Gaming.
● Dutch and moved to the UK in 2006
● Started with Gamesys over 5 year ago.
Gamesys:
● Virgin Games, Tropicana Casino, Jackpotjoy, Sun Bingo
● Slots, Bingo and Poker
● Technologies: HTML5, Canvas, Flash, Android, iOS, Web
Services
March 2018
Selenium overview
March 2018
How does selenium do its web magic?
How does selenium find a web element
How does it get an attribute
How does it click on the web element?
No not “protons, neutrons, and electrons”, but
javascript scripts called atoms.
NOTE: not every action requires atoms (e.g. navigate)
March 2018
How do atoms work?
Find Element example:
(<find-element-atom.js>)("id", "element-id")
response:
"{"status":0,"value":{"ELEMENT":":wdc:1518519286442"}}"
storage:
document.$wdc_
March 2018
How do atoms work (continued)?
click example:
(<click-element-atom.js>)({"ELEMENT":":wdc:1518520215151"})
get-attribute example:
(<get-attribute.js>)({"ELEMENT":":wdc:1518520215152"}, "<attribute-name>"))
Lets see them in
action.
March 2018
So how do we execute the atoms?
How does Appium send the atoms to the browser and how does it retrieve
the response?
Remote Debugging Protocols!
It obviously can’t CTRL+C, CTRL+V like I just did.
March 2018
Remote debugging
{
method: 'Runtime.evaluate',
params: {
expression: 'return document.title'
returnByValue: true
}
};
Execute JavaScript example:
March 2018
Remote debugging (continued)
{
method: 'Page.navigate',
params: {
url: 'http://www.saucecon.com'
}
};
Navigation example:
March 2018
Historical Appium challenges (in 2013)
• Unable to run web tests on Safari on physical devices
• No/little support for remote debugging on mobile browsers
• No easy access to browsers on physical devices
• No ability to launch/close Safari on iOS devices
• Not all features were (yet) covered by Appium
• API was not fully defined (and constantly changing)
• No appium Java client.
Back in the day everything used to be better … uhh, well no.
March 2018
Challenge: Safari on a physical device
My question (April 2013):
“I am trying to grab the window_handles on the WebViewApp and this is working
fine on a iPhone simulator, however it's throwing an unhandled exception
on a real device”
ios-webkit-debug-proxy:
Luckily someone had already figured a way to forward requests to a physical device
and we just connected the dots (Appium - Pull Request 562 – for a laugh ).
Jonathan Lipps:
“This is unfortunately expected. Webview support works by creating a TCP connection
to the remote webkit debugger run in Safari/webviews. Even though
the real device might be running a webkit debugger, it's almost
definitely not forwarding that port to the host, where appium is running.
Someone will need to figure out how to reverse engineer the USB debugging
protocol and forward the port from the device to the host---
sounds like it will be challenging at best and maybe impossible at worst.”
March 2018
Challenge: Launching safari on a
deviceCan we use Instruments?
Can we use remote debugging?
Safari Launcher app
● Just navigate to a url and forces iOS to open Safari
● Add “--real-safari” argument when running reset.sh (build safari launcher with default profile)
● To build & install safari you will need a valid development profile
Can we use … an app?
March 2018
Challenge: Closing tabs on safari
Can we use javascript?
Can we use remote debugging?
Can we use Instruments?
Or can they ?
window.open('','_self').close();
March 2018
iOS (before iOS 9.3) - DEPRECATED
March 2018
iOS XCUITest (iOS 9.3 +)
March 2018
WebInspector vs WebKit protocol
WebInspector protocol wraps the Webkit protocol messages in an
“envelope” and adds additional fields (such as ApplicationIdenitifier,
PageIdentifier, SenderKey, ConnectionIdentier).
So if we use the Runtime.evaluate example, these fields will tell the
web inspector, which app and page it should execute the script on.
March 2018
iOS Web Testing - Pull Request?
March 2018
Android (ChromeDriver)
March 2018
Chrome://inspect
So how does chrome inspect do it?
The same way as appium
March 2018
Android (Selendroid) - DEPRECATED
March 2018
Additional endpoints
Mobile JSON wire Protocol (DRAFT):
• Touch Actions (Tap, Swipe, Pinch)
WebDriver Protocol Extensions:
• Install/Uninstall App, Launch/Close app
• Get Performance Data (Android)
• CPUInfo
• MemInfo
There are many more.
March 2018
Remote Debug Protocol(s)
http://compatibility.remotedebug.org/
March 2018
Future of mobile web testing?
• Network.clearBrowserCache (CDP 1.2)
• Browser.close & Browser.getVersion (CDP 1.3)
• Log.entryAdded (CDP 1.3)
• Synthesize Tap/Pinch (CDP TOT)
• Network.requestIntercepted (CDP TOT)
March 2018
Questions?

More Related Content

PPTX
From Selenium to Appium: How Hard Can It Be? by Sergio Neves Barros
PDF
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
PDF
Bootiful Development with Spring Boot and Vue - RWX 2018
PDF
Microservices for the Masses with Spring Boot and JHipster - RWX 2018
PDF
Learn react the right way
PDF
Bootiful Development with Spring Boot and Angular - RWX 2018
PPTX
Sony lazuardi native mobile app with javascript
PDF
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
From Selenium to Appium: How Hard Can It Be? by Sergio Neves Barros
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
Bootiful Development with Spring Boot and Vue - RWX 2018
Microservices for the Masses with Spring Boot and JHipster - RWX 2018
Learn react the right way
Bootiful Development with Spring Boot and Angular - RWX 2018
Sony lazuardi native mobile app with javascript
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017

What's hot (20)

PDF
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
PDF
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
PDF
Addon sdk content scripts
PPTX
DeveloperWeek2018 - Let's Build a Chatbot
PDF
Rapid Android Development for Hackathon
PDF
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
PDF
Front End Development for Back End Developers - Devoxx UK 2017
PPTX
Micro frontend
PDF
Bootiful Development with Spring Boot and React - GIDS 2019
PDF
Front End Development for Back End Java Developers - Jfokus 2020
PPTX
Top 10 Spring Boot Interview Questions and Answers
PPTX
What is difference between spring MVC and spring boot?
PDF
JavaScript : One To Many
PPTX
How to build your own Hybrid JS Interface with Android?
PPTX
Github security bug bounty hunting
PDF
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
PDF
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
PDF
Microservices for the Masses with Spring Boot, JHipster, and JWT - J-Spring 2017
PDF
How to Win at UI Development in the World of Microservices - THAT Conference ...
PDF
Bringing Swift into your Objective-C Projects
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Addon sdk content scripts
DeveloperWeek2018 - Let's Build a Chatbot
Rapid Android Development for Hackathon
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Front End Development for Back End Developers - Devoxx UK 2017
Micro frontend
Bootiful Development with Spring Boot and React - GIDS 2019
Front End Development for Back End Java Developers - Jfokus 2020
Top 10 Spring Boot Interview Questions and Answers
What is difference between spring MVC and spring boot?
JavaScript : One To Many
How to build your own Hybrid JS Interface with Android?
Github security bug bounty hunting
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
Microservices for the Masses with Spring Boot, JHipster, and JWT - J-Spring 2017
How to Win at UI Development in the World of Microservices - THAT Conference ...
Bringing Swift into your Objective-C Projects
Ad

Similar to Selenium to Appium - how hard can it be (SauceCon). (20)

PPTX
Appium Meetup #2 - Mobile Web Automation Introduction
PDF
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
PDF
Javacro 2014 SemameStreet Grails 2 Speech
PDF
Creating Rajanikant Powered Site
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
PDF
Philip Shurpik "Architecting React Native app"
PPTX
Using AppEngine for Mobile Apps
PDF
Appium - Reality check on the world’s leading Open Source Framework for Mobil...
PDF
From Idea to App (or “How we roll at Small Town Heroes”)
PPT
BarCamp KL H20 Open Social Hackathon
PDF
Cross Platform Mobile Apps with the Ionic Framework
PPTX
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
PPT
Ajaxworld Opensocial Presentation
DOCX
Raman monga
PDF
HTML5 Can't Do That
PPTX
[RakutenTechConf2013] [E-2] HTML5 in Rakuten
PDF
Pwa is the future. The Presentation I gave at PWA event
KEY
Fake it 'til you make it
Appium Meetup #2 - Mobile Web Automation Introduction
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Jforum S...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Javacro 2014 SemameStreet Grails 2 Speech
Creating Rajanikant Powered Site
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Philip Shurpik "Architecting React Native app"
Using AppEngine for Mobile Apps
Appium - Reality check on the world’s leading Open Source Framework for Mobil...
From Idea to App (or “How we roll at Small Town Heroes”)
BarCamp KL H20 Open Social Hackathon
Cross Platform Mobile Apps with the Ionic Framework
So you want to build a mobile app - HTML5 vs. Native @ the Boston Mobile Expe...
Ajaxworld Opensocial Presentation
Raman monga
HTML5 Can't Do That
[RakutenTechConf2013] [E-2] HTML5 in Rakuten
Pwa is the future. The Presentation I gave at PWA event
Fake it 'til you make it
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation theory and applications.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
August Patch Tuesday
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Machine Learning_overview_presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative analysis of optical character recognition models for extracting...
Encapsulation theory and applications.pdf
1. Introduction to Computer Programming.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
OMC Textile Division Presentation 2021.pptx
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
August Patch Tuesday
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
TLE Review Electricity (Electricity).pptx
Heart disease approach using modified random forest and particle swarm optimi...
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Machine Learning_overview_presentation.pptx

Selenium to Appium - how hard can it be (SauceCon).

  • 1. March 2018 Selenium to Appium how hard can it be? Sergio Neves Barros QA Technical Architect
  • 2. March 2018 1. About us 2. Selenium overview 3. Historical challenges 4. Platform overviews 5. Additional endpoints 6. Future of (mobile) web testing Overview
  • 3. March 2018 About us Myself: ● 15 years of testing experience ● Insurance, Banking and Gaming. ● Dutch and moved to the UK in 2006 ● Started with Gamesys over 5 year ago. Gamesys: ● Virgin Games, Tropicana Casino, Jackpotjoy, Sun Bingo ● Slots, Bingo and Poker ● Technologies: HTML5, Canvas, Flash, Android, iOS, Web Services
  • 5. March 2018 How does selenium do its web magic? How does selenium find a web element How does it get an attribute How does it click on the web element? No not “protons, neutrons, and electrons”, but javascript scripts called atoms. NOTE: not every action requires atoms (e.g. navigate)
  • 6. March 2018 How do atoms work? Find Element example: (<find-element-atom.js>)("id", "element-id") response: "{"status":0,"value":{"ELEMENT":":wdc:1518519286442"}}" storage: document.$wdc_
  • 7. March 2018 How do atoms work (continued)? click example: (<click-element-atom.js>)({"ELEMENT":":wdc:1518520215151"}) get-attribute example: (<get-attribute.js>)({"ELEMENT":":wdc:1518520215152"}, "<attribute-name>")) Lets see them in action.
  • 8. March 2018 So how do we execute the atoms? How does Appium send the atoms to the browser and how does it retrieve the response? Remote Debugging Protocols! It obviously can’t CTRL+C, CTRL+V like I just did.
  • 9. March 2018 Remote debugging { method: 'Runtime.evaluate', params: { expression: 'return document.title' returnByValue: true } }; Execute JavaScript example:
  • 10. March 2018 Remote debugging (continued) { method: 'Page.navigate', params: { url: 'http://www.saucecon.com' } }; Navigation example:
  • 11. March 2018 Historical Appium challenges (in 2013) • Unable to run web tests on Safari on physical devices • No/little support for remote debugging on mobile browsers • No easy access to browsers on physical devices • No ability to launch/close Safari on iOS devices • Not all features were (yet) covered by Appium • API was not fully defined (and constantly changing) • No appium Java client. Back in the day everything used to be better … uhh, well no.
  • 12. March 2018 Challenge: Safari on a physical device My question (April 2013): “I am trying to grab the window_handles on the WebViewApp and this is working fine on a iPhone simulator, however it's throwing an unhandled exception on a real device” ios-webkit-debug-proxy: Luckily someone had already figured a way to forward requests to a physical device and we just connected the dots (Appium - Pull Request 562 – for a laugh ). Jonathan Lipps: “This is unfortunately expected. Webview support works by creating a TCP connection to the remote webkit debugger run in Safari/webviews. Even though the real device might be running a webkit debugger, it's almost definitely not forwarding that port to the host, where appium is running. Someone will need to figure out how to reverse engineer the USB debugging protocol and forward the port from the device to the host--- sounds like it will be challenging at best and maybe impossible at worst.”
  • 13. March 2018 Challenge: Launching safari on a deviceCan we use Instruments? Can we use remote debugging? Safari Launcher app ● Just navigate to a url and forces iOS to open Safari ● Add “--real-safari” argument when running reset.sh (build safari launcher with default profile) ● To build & install safari you will need a valid development profile Can we use … an app?
  • 14. March 2018 Challenge: Closing tabs on safari Can we use javascript? Can we use remote debugging? Can we use Instruments? Or can they ? window.open('','_self').close();
  • 15. March 2018 iOS (before iOS 9.3) - DEPRECATED
  • 16. March 2018 iOS XCUITest (iOS 9.3 +)
  • 17. March 2018 WebInspector vs WebKit protocol WebInspector protocol wraps the Webkit protocol messages in an “envelope” and adds additional fields (such as ApplicationIdenitifier, PageIdentifier, SenderKey, ConnectionIdentier). So if we use the Runtime.evaluate example, these fields will tell the web inspector, which app and page it should execute the script on.
  • 18. March 2018 iOS Web Testing - Pull Request?
  • 20. March 2018 Chrome://inspect So how does chrome inspect do it? The same way as appium
  • 22. March 2018 Additional endpoints Mobile JSON wire Protocol (DRAFT): • Touch Actions (Tap, Swipe, Pinch) WebDriver Protocol Extensions: • Install/Uninstall App, Launch/Close app • Get Performance Data (Android) • CPUInfo • MemInfo There are many more.
  • 23. March 2018 Remote Debug Protocol(s) http://compatibility.remotedebug.org/
  • 24. March 2018 Future of mobile web testing? • Network.clearBrowserCache (CDP 1.2) • Browser.close & Browser.getVersion (CDP 1.3) • Log.entryAdded (CDP 1.3) • Synthesize Tap/Pinch (CDP TOT) • Network.requestIntercepted (CDP TOT)