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
57
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
92
Public_Speaking.pdf
jimholmes
0
130
Trusted System Boundaries
jimholmes
0
110
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
140
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
66
Is Quality The Bottleneck?
jimholmes
0
140
Don't Fear Leadership
jimholmes
0
110
Intro To TDD
jimholmes
1
96
Honor Flight #20 (Bay Area) Recap
jimholmes
0
140
Other Decks in Technology
See All in Technology
AIエージェントを構築して感じた、AI時代のCDKとの向き合い方
smt7174
1
230
ストライクウィッチーズ2期6話のエイラの行動が許せないのでPjMの観点から何をすべきだったのかを考える
ichimichi
1
370
Bluesky Meetup in Tokyo vol.4 - 2023to2026
shinoharata
0
180
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
16k
プロンプトエンジニアリングを超えて:自由と統制のあいだでつくる Platform × Context Engineering
yuriemori
0
190
DIPS2.0データに基づく森林管理における無人航空機の利用状況
naokimuroki
1
210
3つのボトルネックを解消し、リリースエンジニアリングを再定義した話
nealle
0
440
60分で学ぶ最新Webフロントエンド
mizdra
PRO
33
16k
"SQLは書けません"から始まる データドリブン
kubell_hr
2
410
JOAI2026講評会資料(近藤佐介)
element138
1
110
ある製造業の会社全体のAI化に1エンジニアが挑んだ話
kitami
2
960
シン・リスコフの置換原則 〜現代風に考えるSOLIDの原則〜
jinwatanabe
0
200
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Building the Perfect Custom Keyboard
takai
2
720
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
220
How GitHub (no longer) Works
holman
316
150k
Navigating Team Friction
lara
192
16k
How to train your dragon (web standard)
notwaldorf
97
6.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Raft: Consensus for Rubyists
vanstee
141
7.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
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