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
49
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
70
Public_Speaking.pdf
jimholmes
0
88
Trusted System Boundaries
jimholmes
0
86
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
110
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
53
Is Quality The Bottleneck?
jimholmes
0
120
Don't Fear Leadership
jimholmes
0
86
Intro To TDD
jimholmes
1
75
Honor Flight #20 (Bay Area) Recap
jimholmes
0
120
Other Decks in Technology
See All in Technology
Progressive Deliveryで支える!スケールする衛星コンステレーションの地上システム運用 / Ground Station Operation for Scalable Satellite Constellation by Progressive Delivery
iselegant
1
190
JAWS-UG SRE支部 #14 LT
okaru
0
110
FFMとJVMの実装から学ぶJavaのインテグリティ
kazumura
0
120
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
4
1.4k
米軍Platform One / Black Pearlに学ぶ極限環境DevSecOps
jyoshise
2
480
グローバルなコンパウンド戦略を支えるモジュラーモノリスとドメイン駆動設計
kawauso
1
860
マイクロリブート ~ACEマインドセットで実現するアジャイル~
sony
1
400
生成AIではじめるテスト駆動開発
puku0x
0
120
ステートレスなLLMでステートフルなAI agentを作る - YAPC::Fukuoka 2025
gfx
8
1.3k
Lazy Constant - finalフィールドの遅延初期化
skrb
0
230
「O(n log(n))のパフォーマンス」の意味がわかるようになろう
dhirabayashi
0
190
QAを"自動化する"ことの本質
kshino
1
130
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
What's in a price? How to price your products and services
michaelherold
246
12k
Agile that works and the tools we love
rasmusluckow
331
21k
It's Worth the Effort
3n
187
28k
GraphQLとの向き合い方2022年版
quramy
49
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Code Reviewing Like a Champion
maltzj
527
40k
Why Our Code Smells
bkeepers
PRO
340
57k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
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