SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Android UI Testing 
with uiautomator 
Jana Moudrá | @Janamou | +JanaMoudrá
Me 
Co-Founder at Juicymo 
GDG ČVUT Prague/GDG Prague 
Web, Android, Design, Dart 
about.me/janamou
Motivation
UI Testing 
UI testing ensures that your 
application returns the correct UI 
output in response to a sequence 
of user actions on a device. 
http://developer.android.com/tools/testing/testing_ui.html
UI Testing 
No knowledge of 
implementation 
Testing and 
implementation 
separated
Manual? 
Time consuming 
Not repeatable 
Error prone
Manual? 
Time consuming 
Not repeatable 
Error prone 
We want to automate
Android?
Android? 
uiautomator
Tests in Java 
Android 4.1 
Device
How to test 
in 3 steps
1 
Create 
the App
2 
Prepare 
the Test
Prepare the Test 
Application is 
accessible 
Application is 
on the device 
Use 
uiautomatorviewer 
Set development 
environment 
Create 
the test
Development environment 
Java project 
+ 
JUnit + uiautomator.jar + android.jar
Use uiautomatorviewer
Create the Test 
extend the 
UiAutomatorTestCase 
class
Use available classes 
UiDevice 
UiSelector 
UiObject 
UiCollection 
UiScrollable
UiSelector 
UiObject threeButton = new UiObject( 
new UiSelector().text("3")); 
threeButton.click();
UiSelector 
UiObject urlForm = new UiObject( 
new UiSelector() 
.resourceId("com.android.browser:id/url")); 
urlForm.setText("http://www.gug.cz"); 
getUiDevice().pressEnter();
What can I do with UiObject? 
Use gestures 
Retrieve attributes 
Set text 
No manipulation
We can use Asserts 
assertEquals(threeButton.getText(), "3");
3 
Run 
the Test
Run the Test 
1) Build with Ant 
2) Push to device 
3) Run the test
DEMO
Thank You! 
Questions??? 
about.me/janamou

Contenu connexe

Tendances

A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testingjotaemepereira
 
Lightning Talk - iOS UI Automated Testing
Lightning Talk - iOS UI Automated TestingLightning Talk - iOS UI Automated Testing
Lightning Talk - iOS UI Automated TestingRafael Sperling
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam Siton
 
Android UI Testing with Espresso
Android UI Testing with EspressoAndroid UI Testing with Espresso
Android UI Testing with EspressoGary Cheng
 
Langkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi androidLangkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi androidAgus Haryanto
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodepCloudy
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installationPoojaBele1
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010Eric D. Boyd
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!Édipo Souza
 
Coded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testCoded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testOmer Karpas
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Daniel Knott
 
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19Tabăra de Testare
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
 

Tendances (20)

Espresso
EspressoEspresso
Espresso
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testing
 
Lightning Talk - iOS UI Automated Testing
Lightning Talk - iOS UI Automated TestingLightning Talk - iOS UI Automated Testing
Lightning Talk - iOS UI Automated Testing
 
Jsunit
JsunitJsunit
Jsunit
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 
Android UI Testing with Espresso
Android UI Testing with EspressoAndroid UI Testing with Espresso
Android UI Testing with Espresso
 
Langkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi androidLangkah-langkah Instalasi software untuk develop aplikasi android
Langkah-langkah Instalasi software untuk develop aplikasi android
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
jQuery Ecosystem
jQuery EcosystemjQuery Ecosystem
jQuery Ecosystem
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010Testing the User Interface - Coded UI Tests with Visual Studio 2010
Testing the User Interface - Coded UI Tests with Visual Studio 2010
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Coded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testCoded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui test
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012
 
Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19Robotium framework & Jenkins CI tools - TdT@Cluj #19
Robotium framework & Jenkins CI tools - TdT@Cluj #19
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 

En vedette

Android testing
Android testingAndroid testing
Android testingJinaTm
 
Android testing
Android testingAndroid testing
Android testingBitbar
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android Aakash Ugale
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation toolsSSGMCE SHEGAON
 
Android complete basic Guide
Android complete basic GuideAndroid complete basic Guide
Android complete basic GuideAKASH SINGH
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublinroland99
 
Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Codemotion
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)Khaled Anaqwa
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Khaled Anaqwa
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration TestingSubho Halder
 
User Interface Testing | Best Practices
User Interface Testing | Best Practices User Interface Testing | Best Practices
User Interface Testing | Best Practices David Tzemach
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security modelPragati Rai
 

En vedette (20)

Android testing
Android testingAndroid testing
Android testing
 
Android testing
Android testingAndroid testing
Android testing
 
Introduction to android testing
Introduction to android testingIntroduction to android testing
Introduction to android testing
 
Android ppt
Android ppt Android ppt
Android ppt
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
Android complete basic Guide
Android complete basic GuideAndroid complete basic Guide
Android complete basic Guide
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
 
Android Data Persistence
Android Data PersistenceAndroid Data Persistence
Android Data Persistence
 
Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...Calabash, an open-source automated testing technology for native mobile, by K...
Calabash, an open-source automated testing technology for native mobile, by K...
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Appium overview
Appium overviewAppium overview
Appium overview
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android & IOS Automation
Android & IOS AutomationAndroid & IOS Automation
Android & IOS Automation
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
 
User Interface Testing | Best Practices
User Interface Testing | Best Practices User Interface Testing | Best Practices
User Interface Testing | Best Practices
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security model
 

Similaire à Android UI Testing with uiautomator

20170302 tryswift tasting_tests
20170302 tryswift tasting_tests20170302 tryswift tasting_tests
20170302 tryswift tasting_testsKazuaki Matsuo
 
Automation Proposal_V1.0
Automation Proposal_V1.0Automation Proposal_V1.0
Automation Proposal_V1.0Dao Nhỏ
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and AndroidOperation Mobile
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariJaved Ansari
 
Top 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaTop 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaEdureka!
 
Mobile applications and automation testing
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testingIndicThreads
 
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo EuteneuerStop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo EuteneuerJAXLondon_Conference
 
Top Automated UI Testing Tools 2023.pdf
Top Automated UI Testing Tools 2023.pdfTop Automated UI Testing Tools 2023.pdf
Top Automated UI Testing Tools 2023.pdfpcloudy2
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2Shem Magnezi
 
Android Apps Testing in 2019
Android Apps Testing in 2019Android Apps Testing in 2019
Android Apps Testing in 2019Ivan Katunou
 
20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuo20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuoKazuaki Matsuo
 
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...İbrahim KIVANÇ
 
Optimize Your Android App's Performance with Expert Testing Services.pptx
Optimize Your Android App's Performance with Expert Testing Services.pptxOptimize Your Android App's Performance with Expert Testing Services.pptx
Optimize Your Android App's Performance with Expert Testing Services.pptxCatherine William
 
Remote (Mobile) Usability Testing Lab
Remote (Mobile) Usability Testing LabRemote (Mobile) Usability Testing Lab
Remote (Mobile) Usability Testing LabJan Moons
 
Advance appium workshop.pptx
Advance appium workshop.pptxAdvance appium workshop.pptx
Advance appium workshop.pptxVodqaBLR
 
2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdf2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdfBelayet Hossain
 
Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)morewebber
 
Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Intuit Inc.
 

Similaire à Android UI Testing with uiautomator (20)

20170302 tryswift tasting_tests
20170302 tryswift tasting_tests20170302 tryswift tasting_tests
20170302 tryswift tasting_tests
 
Automation Proposal_V1.0
Automation Proposal_V1.0Automation Proposal_V1.0
Automation Proposal_V1.0
 
Coded ui test
Coded ui testCoded ui test
Coded ui test
 
Automated UI Testing for Web and Native Apps on iOS and Android
Automated UI Testing for  Web and Native Apps on iOS and AndroidAutomated UI Testing for  Web and Native Apps on iOS and Android
Automated UI Testing for Web and Native Apps on iOS and Android
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed Ansari
 
Top 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | EdurekaTop 10 Mobile Application Testing Tools | Edureka
Top 10 Mobile Application Testing Tools | Edureka
 
Mobile applications and automation testing
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testing
 
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo EuteneuerStop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
 
Top Automated UI Testing Tools 2023.pdf
Top Automated UI Testing Tools 2023.pdfTop Automated UI Testing Tools 2023.pdf
Top Automated UI Testing Tools 2023.pdf
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2
 
Android Apps Testing in 2019
Android Apps Testing in 2019Android Apps Testing in 2019
Android Apps Testing in 2019
 
20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuo20170529 clem kazuaki_matsuo
20170529 clem kazuaki_matsuo
 
Using Robots for App Testing
Using Robots for App Testing Using Robots for App Testing
Using Robots for App Testing
 
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
GDG DevFest Istanbul - Mobile DevOps - Build, Test and Deploy Your Android Ap...
 
Optimize Your Android App's Performance with Expert Testing Services.pptx
Optimize Your Android App's Performance with Expert Testing Services.pptxOptimize Your Android App's Performance with Expert Testing Services.pptx
Optimize Your Android App's Performance with Expert Testing Services.pptx
 
Remote (Mobile) Usability Testing Lab
Remote (Mobile) Usability Testing LabRemote (Mobile) Usability Testing Lab
Remote (Mobile) Usability Testing Lab
 
Advance appium workshop.pptx
Advance appium workshop.pptxAdvance appium workshop.pptx
Advance appium workshop.pptx
 
2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdf2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdf
 
Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)Day 1 Android Apps (Education ICT-Comp Science)
Day 1 Android Apps (Education ICT-Comp Science)
 
Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...Velocity Conference: Increasing Speed To Market In Mobile Development Through...
Velocity Conference: Increasing Speed To Market In Mobile Development Through...
 

Plus de Jana Moudrá

How AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherHow AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherJana Moudrá
 
How to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 minsHow to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 minsJana Moudrá
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsJana Moudrá
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the WebJana Moudrá
 
How to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerHow to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerJana Moudrá
 
Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, DarrrtJana Moudrá
 
Bezpečnost platformy Android
Bezpečnost platformy AndroidBezpečnost platformy Android
Bezpečnost platformy AndroidJana Moudrá
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart languageJana Moudrá
 
Introduction to the Dart - Dart Flight School Liberec Hackathon
Introduction to the Dart - Dart Flight School Liberec Hackathon Introduction to the Dart - Dart Flight School Liberec Hackathon
Introduction to the Dart - Dart Flight School Liberec Hackathon Jana Moudrá
 

Plus de Jana Moudrá (11)

How AngularDart & Firebase did an App together
How AngularDart & Firebase did an App togetherHow AngularDart & Firebase did an App together
How AngularDart & Firebase did an App together
 
How to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 minsHow to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 mins
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
 
Let's Play Dart
Let's Play DartLet's Play Dart
Let's Play Dart
 
How to bake an app in Dart and Polymer
How to bake an app in Dart and PolymerHow to bake an app in Dart and Polymer
How to bake an app in Dart and Polymer
 
Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, Darrrt
 
Dart
DartDart
Dart
 
Bezpečnost platformy Android
Bezpečnost platformy AndroidBezpečnost platformy Android
Bezpečnost platformy Android
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 
Introduction to the Dart - Dart Flight School Liberec Hackathon
Introduction to the Dart - Dart Flight School Liberec Hackathon Introduction to the Dart - Dart Flight School Liberec Hackathon
Introduction to the Dart - Dart Flight School Liberec Hackathon
 

Android UI Testing with uiautomator