Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Four Tips for More Testable UI
Jim Holmes
March 17, 2019
Technology
0
33
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
Public_Speaking.pdf
jimholmes
0
13
Trusted System Boundaries
jimholmes
0
20
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
35
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
28
Is Quality The Bottleneck?
jimholmes
0
62
Don't Fear Leadership
jimholmes
0
20
Intro To TDD
jimholmes
1
35
Honor Flight #20 (Bay Area) Recap
jimholmes
0
90
Coding for Non-Coders workshop
jimholmes
0
79
Other Decks in Technology
See All in Technology
初めてのデータ移行プロジェクトから得た学び
tjmtmmnk
0
330
Deep dive in Reserved Instance ~脳死推奨量購入からの脱却~
kzkmaeda
0
540
PCI DSS に準拠したシステム開発
yutadayo
0
310
Deep Neural Networkの共同学習
hf149
0
280
Stripe / Okta Customer Identity Cloud(旧Auth0) の採用に至った理由 〜モリサワの SaaS 戦略〜
tomuro
0
130
PCL (Point Cloud Library)の基本となぜ点群処理か_2023年_第2版.pdf
cvmlexpertguide
0
170
データ分析基盤の要件分析の話(202201_JEDAI)
yabooun
0
260
AWS Cloud Forensics & Incident Response
e11i0t_4lders0n
0
340
証明書って何だっけ? 〜AWSの中間CA移行に備える〜
minorun365
3
2.1k
CES_2023_FleetWise_demo.pdf
sparkgene
0
110
日経電子版だけじゃない! 日経の新規Webメディアの開発 - NIKKEI Tech Talk #3
sztm
0
320
データベースの発表には RDBMS 以外もありますよ
maroon1st
0
240
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
25
5.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
43k
Building Flexible Design Systems
yeseniaperezcruz
314
35k
Creatively Recalculating Your Daily Design Routine
revolveconf
207
11k
Web Components: a chance to create the future
zenorocha
304
40k
Clear Off the Table
cherdarchuk
79
290k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
31
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
224
50k
The Language of Interfaces
destraynor
149
21k
GitHub's CSS Performance
jonrohan
1020
430k
Building an army of robots
kneath
301
40k
Infographics Made Easy
chrislema
235
17k
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