SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Setting Apple’s
UIAutomation Free
with Appium
Dan Cuellar
d@zoosk.com
Lead Software Engineer, Test Team
Overview
 The Problem
 The Solution
 Run UIAutomation From The Command Line
 Break It Out Of Javascript
 Control it in Real-Time
 How to Code With Appium
 Demo
 Odds & Ends
The Problem
The Problem w/ UIAutomation
 runs only in Instruments.app
 must be written in Javascript
 does not support realtime control
 many useful js methods (e.g. HTTP requests) have been
removed
 difficult to build libraries and re-use code
 cannot integrate w/ existing Selenium automation
 requires adding http servers to your app’s source code
The Solution
Solving the Problem
 need command line control
 needs to run on the simulator and real devices
 need to break out of javascript
 need realtime control
 should not require you to add code to your app
 shoud not require the application source code
Command Line Control
 /usr/bin/instruments
 -t templatePath (path to Automation.tracetemplate)
 (path to compiled ios application)
 -e UIASCRIPT (path to UIAutomation javascript test)
 -e UIARESULTSPATH (path where results will be saved)
 [-w device udid]
 /usr/bin/xcodebuild (run inside project.xcodeproj)
 -sdk (sdk version)
 -target (build target)
 [-scheme (scheme)]
 TARGETED_DEVICE_FAMILY=1|2 (1=iPhone, 2=iPad)
Breaking Out Of Javascript
No HTTP Web Requests in UIAutomation JS
However…
host.performTaskWithPathArgumentsTimeout() can run all
your favorite shell commands
so with friends like cat, curl, and python who needs
Javascript and its HTTP web request methods
… and Don’t Forget the AppleScript (comes in handy when
you need to dismiss OS permissions dialogs)
Making It Real-Time
 Technique 1, file based communication
 Javascript loop looking for sequentially number files in a
predetermined folder for commands
 Have your program write raw javascript to the file
 Read the file using cat
 Run the command using eval()
 Write the sequentially numbered response file using
whatever you like (I chose python)
 Technique 2, setup a proxy web service
 Curl to ask if there’s a command you should run
 Curl back posting the result
Result
 Now you can control UIAutomation from any language
that can write files or make web requests
 You can reuse all that non javascript based (java, c#,
python, ruby, php) automation code you have for your
selenium tests
 Run tests that use a web browser and an iOS device at the
same time
 The possibilities are endless
Coding w/ Appium
Pre-Requisites
 install Xcode
 install Xcode Command Line Tools
 Set up a ~/.appium file
[appium]
username = an_osx_admin_username
password = an_osx_admin_password
OPTIONAL
 sudo easy_install pip
 sudo pip install bottle (required for webdriver server)
 sudo pip install selenium (required to code against the webdriver
server)
Running Appium
 git clone git://github.com/hugs/appium
 To launch the UIAutomation javascript interpretter
 python appium.py “/path/to/my.app”
 To launch the webdriver server
 Python server.py “/path/to/my.app”
Coding Appium like Selenium
from selenium import webdriver
command_url = “http://localhost:4723/wd/hub”
iphone = webdriver.DesiredCapabilities.IPHONE
driver = webdriver.Remote(command_url, iphone)
fields = driver.find_elements_by_tag_name('textField’)
fields[0].send_keys(3)
fields[1].send_keys(4)
buttons = driver.find_elements_by_tag_name('button’)
buttons[0].click()
Demo
Odds & Ends
Failed Prototypes
 Applescript iOS Simulator Automation
 Did not work on actual devices
 Seemed to be highly sensitive to iOS and OS X version
 Not a reliable
 Javascript Server Within UIAutomation
 I could not get a server booted up while running in
Instruments
Pitfalls
 Bug in UIAutomation causes 1 second delay between
commands
 I get around this by sending batches of commands
 Noticed NIBs and XIBs are supported while storyboards
are a more of a crapshoot
 It’s tricky to make elements accessible in objective C
 Some controls (UISegmentedControl) are missing supported
accessibility methods
 Applying a label to text will hinder your ability to read the
text in the control (you need to encapsulate it)
Resources
Appium Project
 https://github.com/hugs/appium or
http://appium.io
Discussion
 https://groups.google.com/d/forum/appium-discuss

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Selenium IDE
Introduction to Selenium IDEIntroduction to Selenium IDE
Introduction to Selenium IDEdrnikki
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànNexus FrontierTech
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkAndrea Tino
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Yuriy Gerasimov
 
Automating with selenium2
Automating with selenium2Automating with selenium2
Automating with selenium2mindqqa
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JSMichael Haberman
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using seleniummindqqa
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam Siton
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentationAndrei Burian
 
Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)Sriram Angajala
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Yuriy Gerasimov
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverPankaj Biswas
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascriptkhanhdang1214
 

Was ist angesagt? (20)

Introduction to Selenium IDE
Introduction to Selenium IDEIntroduction to Selenium IDE
Introduction to Selenium IDE
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation framework
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011
 
Automating with selenium2
Automating with selenium2Automating with selenium2
Automating with selenium2
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
 
Selenium ide material (1)
Selenium ide material (1)Selenium ide material (1)
Selenium ide material (1)
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 

Andere mochten auch

Decreasing false positives in automated testing
Decreasing false positives in automated testingDecreasing false positives in automated testing
Decreasing false positives in automated testingSauce Labs
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-AutomationMindfire Solutions
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobiGnosis
 
Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016Dan Cuellar
 
Mobile App Testing Checklist
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing ChecklistManoj Lonar
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testingSoftheme
 
Test cases for testing mobile phone
Test cases for testing mobile phoneTest cases for testing mobile phone
Test cases for testing mobile phoneAshwini Kamble
 
Testing Techniques for Mobile Applications
Testing Techniques for Mobile ApplicationsTesting Techniques for Mobile Applications
Testing Techniques for Mobile ApplicationsIndicThreads
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application TestingSWAAM Tech
 
Manoj resume
Manoj resumeManoj resume
Manoj resumetekwissen
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAndrii Dzynia
 
Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Sauce Labs
 
Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Thoughtworks
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using AppiumMindfire Solutions
 

Andere mochten auch (18)

Decreasing false positives in automated testing
Decreasing false positives in automated testingDecreasing false positives in automated testing
Decreasing false positives in automated testing
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-Automation
 
Mobile Application Testing Training Presentation
Mobile Application Testing Training PresentationMobile Application Testing Training Presentation
Mobile Application Testing Training Presentation
 
Api testing
Api testingApi testing
Api testing
 
Next level of Appium
Next level of AppiumNext level of Appium
Next level of Appium
 
Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016Advanced Appium: SeleniumConf UK 2016
Advanced Appium: SeleniumConf UK 2016
 
Mobile App Testing Checklist
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing Checklist
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
Test cases for testing mobile phone
Test cases for testing mobile phoneTest cases for testing mobile phone
Test cases for testing mobile phone
 
Testing Techniques for Mobile Applications
Testing Techniques for Mobile ApplicationsTesting Techniques for Mobile Applications
Testing Techniques for Mobile Applications
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Manoj resume
Manoj resumeManoj resume
Manoj resume
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Appium
AppiumAppium
Appium
 
Appium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriverAppium Mobile Test Automation like WebDriver
Appium Mobile Test Automation like WebDriver
 
Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)
 
Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015Mobile Automation Using Appium - vodQA Bangalore 2015
Mobile Automation Using Appium - vodQA Bangalore 2015
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 

Ähnlich wie Setting UIAutomation free with Appium

The Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native AppsThe Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native AppsSauce Labs
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaSandeep Tol
 
Performance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-MechanizePerformance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-Mechanizecoreygoldberg
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding documentAkshay Pillay
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Mikkel Flindt Heisterberg
 
Selenium Automation in Java Using HttpWatch Plug-in
 Selenium Automation in Java Using HttpWatch Plug-in  Selenium Automation in Java Using HttpWatch Plug-in
Selenium Automation in Java Using HttpWatch Plug-in Sandeep Tol
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesPavol Pitoňák
 
UI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricksUI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricksTsimafei Avilin
 
Watir Presentation Sumanth Krishna. A
Watir Presentation   Sumanth Krishna. AWatir Presentation   Sumanth Krishna. A
Watir Presentation Sumanth Krishna. ASumanth krishna
 
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QAFest
 
Comprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA ToolsComprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA ToolsAshish Bansal
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Matthew McCullough
 
Appium basics
Appium basicsAppium basics
Appium basicsSyam Sasi
 

Ähnlich wie Setting UIAutomation free with Appium (20)

The Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native AppsThe Future of Selenium Testing for Mobile Web and Native Apps
The Future of Selenium Testing for Mobile Web and Native Apps
 
Using HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in JavaUsing HttpWatch Plug-in with Selenium Automation in Java
Using HttpWatch Plug-in with Selenium Automation in Java
 
Performance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-MechanizePerformance and Scalability Testing with Python and Multi-Mechanize
Performance and Scalability Testing with Python and Multi-Mechanize
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Applets
AppletsApplets
Applets
 
Appium understanding document
Appium understanding documentAppium understanding document
Appium understanding document
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Selenium Automation in Java Using HttpWatch Plug-in
 Selenium Automation in Java Using HttpWatch Plug-in  Selenium Automation in Java Using HttpWatch Plug-in
Selenium Automation in Java Using HttpWatch Plug-in
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
UI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricksUI Automation_White_CodedUI common problems and tricks
UI Automation_White_CodedUI common problems and tricks
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Watir Presentation Sumanth Krishna. A
Watir Presentation   Sumanth Krishna. AWatir Presentation   Sumanth Krishna. A
Watir Presentation Sumanth Krishna. A
 
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
 
Comprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA ToolsComprehensive List of Open Source QA Tools
Comprehensive List of Open Source QA Tools
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
Appium solution
Appium solutionAppium solution
Appium solution
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Selenium
SeleniumSelenium
Selenium
 
Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Appium basics
Appium basicsAppium basics
Appium basics
 

Mehr von Dan Cuellar

Selenium Camp 2016
Selenium Camp 2016Selenium Camp 2016
Selenium Camp 2016Dan Cuellar
 
Writing Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloWriting Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloDan Cuellar
 
How to Give a Successful Lightning Talk
How to Give a Successful Lightning TalkHow to Give a Successful Lightning Talk
How to Give a Successful Lightning TalkDan Cuellar
 
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CN
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CNCreating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CN
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CNDan Cuellar
 
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - EN
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - ENStarting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - EN
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - ENDan Cuellar
 

Mehr von Dan Cuellar (6)

Advanced Appium
Advanced AppiumAdvanced Appium
Advanced Appium
 
Selenium Camp 2016
Selenium Camp 2016Selenium Camp 2016
Selenium Camp 2016
 
Writing Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloWriting Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of Jello
 
How to Give a Successful Lightning Talk
How to Give a Successful Lightning TalkHow to Give a Successful Lightning Talk
How to Give a Successful Lightning Talk
 
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CN
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CNCreating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CN
Creating an Open Source Project: 0-100k Users - China Mobile Summit 2015 - CN
 
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - EN
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - ENStarting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - EN
Starting an Open Source Project: 0-100k Users - China Mobile Summit 2015 - EN
 

Kürzlich hochgeladen

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Setting UIAutomation free with Appium

  • 1. Setting Apple’s UIAutomation Free with Appium Dan Cuellar d@zoosk.com Lead Software Engineer, Test Team
  • 2. Overview  The Problem  The Solution  Run UIAutomation From The Command Line  Break It Out Of Javascript  Control it in Real-Time  How to Code With Appium  Demo  Odds & Ends
  • 4. The Problem w/ UIAutomation  runs only in Instruments.app  must be written in Javascript  does not support realtime control  many useful js methods (e.g. HTTP requests) have been removed  difficult to build libraries and re-use code  cannot integrate w/ existing Selenium automation  requires adding http servers to your app’s source code
  • 6. Solving the Problem  need command line control  needs to run on the simulator and real devices  need to break out of javascript  need realtime control  should not require you to add code to your app  shoud not require the application source code
  • 7. Command Line Control  /usr/bin/instruments  -t templatePath (path to Automation.tracetemplate)  (path to compiled ios application)  -e UIASCRIPT (path to UIAutomation javascript test)  -e UIARESULTSPATH (path where results will be saved)  [-w device udid]  /usr/bin/xcodebuild (run inside project.xcodeproj)  -sdk (sdk version)  -target (build target)  [-scheme (scheme)]  TARGETED_DEVICE_FAMILY=1|2 (1=iPhone, 2=iPad)
  • 8. Breaking Out Of Javascript No HTTP Web Requests in UIAutomation JS However… host.performTaskWithPathArgumentsTimeout() can run all your favorite shell commands so with friends like cat, curl, and python who needs Javascript and its HTTP web request methods … and Don’t Forget the AppleScript (comes in handy when you need to dismiss OS permissions dialogs)
  • 9. Making It Real-Time  Technique 1, file based communication  Javascript loop looking for sequentially number files in a predetermined folder for commands  Have your program write raw javascript to the file  Read the file using cat  Run the command using eval()  Write the sequentially numbered response file using whatever you like (I chose python)  Technique 2, setup a proxy web service  Curl to ask if there’s a command you should run  Curl back posting the result
  • 10. Result  Now you can control UIAutomation from any language that can write files or make web requests  You can reuse all that non javascript based (java, c#, python, ruby, php) automation code you have for your selenium tests  Run tests that use a web browser and an iOS device at the same time  The possibilities are endless
  • 12. Pre-Requisites  install Xcode  install Xcode Command Line Tools  Set up a ~/.appium file [appium] username = an_osx_admin_username password = an_osx_admin_password OPTIONAL  sudo easy_install pip  sudo pip install bottle (required for webdriver server)  sudo pip install selenium (required to code against the webdriver server)
  • 13. Running Appium  git clone git://github.com/hugs/appium  To launch the UIAutomation javascript interpretter  python appium.py “/path/to/my.app”  To launch the webdriver server  Python server.py “/path/to/my.app”
  • 14. Coding Appium like Selenium from selenium import webdriver command_url = “http://localhost:4723/wd/hub” iphone = webdriver.DesiredCapabilities.IPHONE driver = webdriver.Remote(command_url, iphone) fields = driver.find_elements_by_tag_name('textField’) fields[0].send_keys(3) fields[1].send_keys(4) buttons = driver.find_elements_by_tag_name('button’) buttons[0].click()
  • 15. Demo
  • 17. Failed Prototypes  Applescript iOS Simulator Automation  Did not work on actual devices  Seemed to be highly sensitive to iOS and OS X version  Not a reliable  Javascript Server Within UIAutomation  I could not get a server booted up while running in Instruments
  • 18. Pitfalls  Bug in UIAutomation causes 1 second delay between commands  I get around this by sending batches of commands  Noticed NIBs and XIBs are supported while storyboards are a more of a crapshoot  It’s tricky to make elements accessible in objective C  Some controls (UISegmentedControl) are missing supported accessibility methods  Applying a label to text will hinder your ability to read the text in the control (you need to encapsulate it)
  • 19. Resources Appium Project  https://github.com/hugs/appium or http://appium.io Discussion  https://groups.google.com/d/forum/appium-discuss