Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
[Jana Moudra] Hands-on with UI testing for Andr...
Search
Google Developers Group Lviv
September 09, 2016
Technology
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[Jana Moudra] Hands-on with UI testing for Android developers
Presentation from GDG DevFest Ukraine 2016.
Learn more at:
https://devfest.gdg.org.ua
Google Developers Group Lviv
September 09, 2016
More Decks by Google Developers Group Lviv
See All by Google Developers Group Lviv
[Elad Bezalel] Angular Material CDK
gdglviv
1
190
[Zac Sweers] Breaking the Android ClassLoader
gdglviv
1
280
[Daniel Galpin] Adventures in Navigation
gdglviv
2
610
[Rebecca Franks] Practical Image Processing in Android
gdglviv
1
510
[Mateusz Herych] Architecture for App Bundles
gdglviv
2
160
[Andrea Falcone] Iterative Mobile Development
gdglviv
2
160
[Yonatan Levin] Keynote: The world of change and your significance in it
gdglviv
1
180
[Denys Tkalich] Using BigQuery as a data warehouse in B2B startup
gdglviv
1
160
[Mete Atamel] Google Assistant powered by Containers, Machine Learning and .NET on Google Cloud
gdglviv
1
200
Other Decks in Technology
See All in Technology
kintoneで在庫管理システムを作るときの要件定義・設計ポイント
kai0707
0
110
Deep Data Security 機能解説
oracle4engineer
PRO
3
950
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
470
AWS Continuum for Penetration Testing に Deep Dive してみる
asanoharuki
2
1.4k
生成AI時代、PMは事業責任者に進化するともっと面白い〜PMだからこそ事業構造を動かせる時代に〜
kakehashi
PRO
1
930
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
330
自宅サーバと脆弱性
masakiokuda
1
120
アカウント統制の健康診断
kenichinakamura
1
210
Patterns in AI Driven Software Development
akosma
PRO
0
260
PostgreSQL at Microsoft: Open Source, AI, & Cloud | Claire Giordano | PGConf.EU 2026
clairegiordano
0
110
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
120
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
0
130
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Designing for Timeless Needs
cassininazir
1
530
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
470
Thoughts on Productivity
jonyablonski
76
5.4k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
950
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Music & Morning Musume
bryan
48
7.5k
sira's awesome portfolio website redesign presentation
elsirapls
0
470
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Git: the NoSQL Database
bkeepers
PRO
433
67k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Transcript
UI TESTING for Android Developers Jana Moudrá @Janamou +JanaMoudra
Eh, tests?
Motivation
I tested the app myself...
Not repeatable Time consuming Error-prone Manual Testing
WE WANT TO AUTOMATE
UI testing lets you ensure that your app meets its
functional requirements and achieves a high standard of quality... Source: developer.android.com/training/testing/ui-testing/index.html
ANDROID!
UI Automator vs Espresso Simulates user interactions UI Testing on
Android
src/androidTest/java folder JUnit 4 tests Runs on same device as
app Android tests how to
UI AUTOMATOR
For many apps System apps No app source code Interacts
with visible elements UI Automator
Android 4.3 (18) or higher Works with AndroidJUnitRunner UI Automator
requirements
android { defaultConfig { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } UI Automator
setup build.gradle
dependencies { androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' } UI Automator setup
build.gradle
android:contentDescription for ImageView etc. android:hint for EditText UI Automator accessibility
UI Automator Viewer <android-sdk>/tools/
assertEquals(hiButton.getText(), "Hi"); UI Automator asserts
UiDevice UiSelector UiObject UiCollection UiScrollable Configurator UI Automator API
ESPRESSO
For a single app Not for system apps App source
code Espresso
Android 2.2 (8) or higher Works with AndroidJUnitRunner Espresso requirements
android { defaultConfig { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } Espresso setup
build.gradle
dependencies { androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' } Espresso setup build.gradle
For Settings/Developer Options: Window animation scale Transition animation scale Animator
duration scale Turn off Animations
ActivityTestRule ViewMatchers ViewActions ViewAssertions Espresso API
Espresso Intents - extension for validation and mocking of Intents
Espresso Contrib - additional features for great tests (RecyclerView) Even more Espresso
WHICH SHOULD I USE?
Black box vs White box Multiple apps vs Single app
Without source code vs With source code UI Automator vs Espresso
Use gestures Retrieve attributes Set text No manipulation What can
I do with UI tests?
Monkey Espresso Test Recorder Firebase Test Lab Other tools
Robolectric Appium Calabash Selendroid Other libraries
NO MORE UNTESTED APPS! Jana Moudrá @Janamou +JanaMoudra
UI TESTING WORKSHOP Jana Moudrá @Janamou +JanaMoudra
1. UI Automator 2. Espresso 3. Test recorder 4. Monkey
Workshop summary
github.com/Janamou/android-testing-codelab Repository
None
• reynermedia, cc, https://www.flickr.com/photos/89228431@N06/1128559 2553/ Image credits