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
43
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
55
Public_Speaking.pdf
jimholmes
0
69
Trusted System Boundaries
jimholmes
0
71
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
90
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
45
Is Quality The Bottleneck?
jimholmes
0
100
Don't Fear Leadership
jimholmes
0
70
Intro To TDD
jimholmes
1
58
Honor Flight #20 (Bay Area) Recap
jimholmes
0
100
Other Decks in Technology
See All in Technology
toittaにOpenTelemetryを導入した話 / Mackerel APM リリースパーティ
cohalz
1
490
Babylon.jsでゲームを作ってみよう
limes2018
0
100
MCP Clientを活用するための設計と実装上の工夫
yudai00
1
810
データプレーンプログラミングとは? DPU&スイッチASICの開発経験から語る
ebiken
PRO
1
270
Introduction to Bill One Development Engineer
sansan33
PRO
0
240
Flutterアプリを⾃然⾔語で操作する
yukisakai1225
0
110
他チームへ越境したら、生データ提供ソリューションのクエリ費用95%削減へ繋がった話 / Cross-Team Impact: 95% Off Raw Data Query Costs
yamamotoyuta
0
240
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
OTel meets Wasm: プラグイン機構としてのWebAssemblyから見る次世代のObservability
lycorptech_jp
PRO
1
300
Eight Engineering Unit 紹介資料
sansan33
PRO
0
3.2k
うちの会社の評判は?SNSの投稿分析にAIを使ってみた
doumae
0
290
ソフトウェアテストのAI活用_ver1.10
fumisuke
0
240
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Facilitating Awesome Meetings
lara
54
6.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
620
GraphQLとの向き合い方2022年版
quramy
46
14k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
15
890
Navigating Team Friction
lara
186
15k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Cult of Friendly URLs
andyhume
78
6.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
A designer walks into a library…
pauljervisheath
205
24k
Site-Speed That Sticks
csswizardry
7
590
Optimising Largest Contentful Paint
csswizardry
37
3.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