Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Four Tips for More Testable UI
Search
Jim Holmes
March 17, 2019
Technology
61
0
Share
Four Tips for More Testable UI
Quick talk given at the 2019 Microsoft MVP summit during the ALM group's MVP2MVP sessions.
Jim Holmes
March 17, 2019
More Decks by Jim Holmes
See All by Jim Holmes
Adapting to Change in Software Delivery
jimholmes
0
100
Public_Speaking.pdf
jimholmes
0
140
Trusted System Boundaries
jimholmes
0
130
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
150
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
73
Is Quality The Bottleneck?
jimholmes
0
150
Don't Fear Leadership
jimholmes
0
120
Intro To TDD
jimholmes
1
100
Honor Flight #20 (Bay Area) Recap
jimholmes
0
160
Other Decks in Technology
See All in Technology
「速く作る」から「正しく作る」へ ─ 生成AI時代の開発フロー改革の ロードマップと実行 ─
starfish719
0
6.3k
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
2.4k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
170
Chart.js が簡単に使えるようになっていたので OGP 画像生成に使った話
kamekyame
0
140
Spring Boot における AOT Cache 活用テクニックと 起動時間改善事例
ntt_dsol_java
0
200
AI と創る新たな世界 / A New World Created with AI
ks91
PRO
0
100
新規事業を牽引する技術選定 〜フルスタックTypeScript開発の実践事例〜
nullnull
2
290
noUncheckedIndexedAccess、3時間、1万円。 / noUncheckedIndexedAccess, 3 Hours, 10,000 JPY.
kaonavi
1
230
Unlocking the Apps
pimterry
0
190
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
150
Mastering Ruby Box
tagomoris
3
140
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
720
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
960
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
Code Review Best Practice
trishagee
74
20k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
310
Are puppies a ranking factor?
jonoalderson
1
3.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
WENDY [Excerpt]
tessaabrams
11
38k
Transcript
Testable UIs
Or: How to help your test automation folks drink less
[email protected]
@aJimHolmes
Fortune 10 client Java 6 Enterprise-ready components HP build and
SCM tools “What’s a unit test?”
Thank you ET
Generalized Talk Ideas apply to all UI and automation tools
https://github.com/jimholmes/ Demo-Site
Two main problems in all UI testing
Finding Stuff
Async
Also SharePoint
Finding stuff == Locators
For Web, prefer: IDs CSS/JQuery-ish Name Custom Attributes
As a last resort: XPath
None
Create Good Locators
0) Own Your HTML
None
None
None
FindElement.ById(“grid”)
None
None
1) Understand your controls / frameworks
None
None
None
FindElement.ByCss( “some big stupid CSS string”)
Someone changes style
None
None
None
FindElement.ById( “update-btn”)
2) Tweak dynamic data
None
Find elements by text content. Might not be granular enough.
None
None
No useful attributes
None
None
None
ID is position-based. Data changes, IDs change.
None
We own the code!
Is there some useful data in your objects?
None
None
None
None
None
FindElement.ById( contains(“Cobb”) )
“Name” isn’t all that useful. Got contract numbers? Project IDs?
Other stuff? Find good metadata!
3) Make complex async less painful
None
SharePoint
wait until expected condition 1 wait until expected condition 2
IF SOMETHING wait until expected condition 3 IF SOMETHING ELSE wait until expected condition 4 FINALLY wait until expected condition 342
We own the code!
Create “flags” when async is complete
None
None
None
None
None
Wait until flags.div(responseType=create) exists
0) Add static IDs 1) Tweak controls 2) Use data
for locators 3) Build flags/latches for complex async
None
https://github.com/jimholmes/ Demo-Site