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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jim Holmes
March 17, 2019
Technology
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
110
Public_Speaking.pdf
jimholmes
0
140
Trusted System Boundaries
jimholmes
0
130
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
160
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
75
Is Quality The Bottleneck?
jimholmes
0
160
Don't Fear Leadership
jimholmes
0
120
Intro To TDD
jimholmes
1
110
Honor Flight #20 (Bay Area) Recap
jimholmes
0
160
Other Decks in Technology
See All in Technology
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
0
240
Retriever と Reranker、結局どうする?
kazuaki
1
460
1台から試せる!Edge IoTを使った位置情報の活用設計【SORACOM Discovery 2026】
soracom
PRO
0
110
なぜ、あなたのエージェントは言うことを聞かないのか
segavvy
1
580
論語・武士道・産業革命から見る かわるもの、かわらないもの
ichimichi
8
1.6k
DevOps Agentで運用判断をチーム資産にする~Agent InstructionsとAgent Skillを継続的に育てる~
fujioka6789
0
170
StepFunctionsとGraphRAGを活用した暗黙知活用のためのRAG基盤
yakumo
0
190
Amazon Bedrock Managed Knowledge BaseDive Deep
ren8k
0
250
どこまでAIに任せるか 〜確率論と決定論の境界決定〜
shukob
0
560
LangfuseによるLLMOps基盤の構築と活用事例
zozotech
PRO
1
160
VPCセキュリティ対応の最新事情
nagisa53
1
350
『モンスターストライク』 の運営に伴走する! データ民主化への 解析グループの3つのアプローチ
mixi_engineers
PRO
0
170
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
350
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
Accessibility Awareness
sabderemane
1
160
New Earth Scene 8
popppiees
3
2.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Faster Mobile Websites
deanohume
310
32k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
640
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
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