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
43
Public_Speaking.pdf
jimholmes
0
60
Trusted System Boundaries
jimholmes
0
59
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
80
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
39
Is Quality The Bottleneck?
jimholmes
0
89
Don't Fear Leadership
jimholmes
0
61
Intro To TDD
jimholmes
1
49
Honor Flight #20 (Bay Area) Recap
jimholmes
0
97
Other Decks in Technology
See All in Technology
軽量DDDはもういらない! スタイルガイド本で OOPの実装パターンを学ぼう
panda_program
29
11k
Lambdaと地方とコミュニティ
miu_crescent
2
230
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
3
260
freeeのモバイルエンジニアについて
freee
1
100
Postmanの日本市場におけるDevRel (的) 活動 / Postman's DevRelish activities in Japan
yokawasa
1
120
私はこうやってマインドマップでテストすることを出す!
mineo_matsuya
0
210
Railsで4GBのデカ動画ファイルのアップロードと配信、どう実現する?
asflash8
1
210
AI機能の開発運用のリアルと今後のリアル
akiroom
0
250
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
190
2024年グライダー曲技世界選手権参加報告/2024 WGAC report
jscseminar
0
200
Microsoft Intune アプリのトラブルシューティング
sophiakunii
1
400
Exadata Database Service on Cloud@Customer セキュリティ、ネットワーク、および管理について
oracle4engineer
PRO
0
1.1k
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Why Our Code Smells
bkeepers
PRO
334
57k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Ruby is Unlike a Banana
tanoku
96
11k
Scaling GitHub
holman
458
140k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Code Review Best Practice
trishagee
64
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