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
0
42
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
Tweet
Share
More Decks by Jim Holmes
See All by Jim Holmes
Adapting to Change in Software Delivery
jimholmes
0
48
Public_Speaking.pdf
jimholmes
0
64
Trusted System Boundaries
jimholmes
0
63
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
83
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
41
Is Quality The Bottleneck?
jimholmes
0
92
Don't Fear Leadership
jimholmes
0
64
Intro To TDD
jimholmes
1
50
Honor Flight #20 (Bay Area) Recap
jimholmes
0
98
Other Decks in Technology
See All in Technology
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
PaaSの歴史と、 アプリケーションプラットフォームのこれから
jacopen
7
1.5k
Building Scalable Backend Services with Firebase
wisdommatt
0
110
AIアプリケーション開発でAzure AI Searchを使いこなすためには
isidaitc
1
130
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
130
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
260
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
190
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
[JSAC 2025 LT] Introduction to MITRE ATT&CK utilization tools by multiple LLM agents and RAG
4su_para
1
100
30分でわかる「リスクから学ぶKubernetesコンテナセキュリティ」/30min-k8s-container-sec
mochizuki875
3
450
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
870
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
Featured
See All Featured
For a Future-Friendly Web
brad_frost
176
9.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Become a Pro
speakerdeck
PRO
26
5.1k
Optimising Largest Contentful Paint
csswizardry
33
3k
Typedesign – Prime Four
hannesfritz
40
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Language of Interfaces
destraynor
155
24k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
What's in a price? How to price your products and services
michaelherold
244
12k
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