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
180
[Zac Sweers] Breaking the Android ClassLoader
gdglviv
1
270
[Daniel Galpin] Adventures in Navigation
gdglviv
2
600
[Rebecca Franks] Practical Image Processing in Android
gdglviv
1
500
[Mateusz Herych] Architecture for App Bundles
gdglviv
2
160
[Andrea Falcone] Iterative Mobile Development
gdglviv
2
150
[Yonatan Levin] Keynote: The world of change and your significance in it
gdglviv
1
170
[Denys Tkalich] Using BigQuery as a data warehouse in B2B startup
gdglviv
1
150
[Mete Atamel] Google Assistant powered by Containers, Machine Learning and .NET on Google Cloud
gdglviv
1
190
Other Decks in Technology
See All in Technology
[2026 Oracle Technical Deep Dive] AI時代のデータベース基盤をどう選ぶ? Exadata Database Serviceの選択肢と使い分け (2026年9月17日開催)
oracle4engineer
PRO
0
140
形式手法を使って仕様をコーディングしよう
mikanichinose
0
160
ログラスのマルチプロダクトを 支える認証基盤 〜テナントごとに異なる統制とどう向き合うか〜
dada4386
3
310
インバスケット試験対策アプリを 作って見えたAIエージェント構築 ナレッジ2選
shichijoyuhi
1
110
雪かき部 #7 もう怖くない!SELECT文!
foursue
0
270
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
310
GitHub Agentic Workflows を触ってみる
htkym
2
910
AI駆動開発で仕様はどこまで書くべきか? ― 人とAIの責務境界から考える開発プロセスの実践
takahiromatsui
1
280
The kernel report
ennael
PRO
1
190
OpenClawでAzure DevOpsのWiki更新を自動化する - クラウドAIだけでは届かない場所へ
yutakaosada
0
140
覗いてみよう 関数型ビジュアル言語×2Dグラフィックスの世界
yohyamasaki
0
160
『GOエコノミー 』(相乗りサービス) におけるスペック駆動開発
mot_techtalk
1
150
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Into the Great Unknown - MozCon
thekraken
41
2.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
We Are The Robots
honzajavorek
0
380
RailsConf 2023
tenderlove
30
1.6k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Music & Morning Musume
bryan
48
7.4k
Writing Fast Ruby
sferik
630
63k
Everyday Curiosity
cassininazir
0
340
Faster Mobile Websites
deanohume
310
32k
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