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
37
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
27
Public_Speaking.pdf
jimholmes
0
50
Trusted System Boundaries
jimholmes
0
59
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
79
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
38
Is Quality The Bottleneck?
jimholmes
0
86
Don't Fear Leadership
jimholmes
0
54
Intro To TDD
jimholmes
1
48
Honor Flight #20 (Bay Area) Recap
jimholmes
0
97
Other Decks in Technology
See All in Technology
公共領域から学ぶ クラウド移行についてエンジニアが意識していること
kawakawa2222
0
140
Datadog Cloud SIEMを使ってAWS環境の脅威を可視化した話/lifeistech-datadog-cloud-siem
gidajun
0
480
CEL(Common Expression Language)で書いた条件にマッチしたIAM Policyを見つける / iam-policy-finder
fujiwara3
0
710
テストケースの自動生成に生成AIの導入を試みた話と生成AIによる今後の期待
shift_evolve
0
180
テスト・設計研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
170
[NIKKEI Tech Talk] KDDI/KAG Scrum & Community for Engineering Training
curanosuke
2
220
20240724_cm_odyssey_hibiyatech
hiashisan
0
110
「我々はどこに向かっているのか」を問い続けるための仕組みづくり / Establishing a System for Continuous Inquiry about where we are
daitasu
0
170
Flutter研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
160
Luupの開発組織におけるインシデントマネジメントの変遷 ver.RoadtoSRENEXT2024
grimoh
1
270
LLMアプリケーションの評価の実践と課題 ~PharmaXにおける今後の展望~
pharma_x_tech
2
160
Azure Pipelinesを使用したCICDベースラインアーキテクチャ実践
yuriemori
0
190
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
Embracing the Ebb and Flow
colly
81
4.3k
How to Think Like a Performance Engineer
csswizardry
4
590
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
52k
BBQ
matthewcrist
82
9k
Infographics Made Easy
chrislema
238
18k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
224
21k
Unsuck your backbone
ammeep
666
57k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
19k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Fireside Chat
paigeccino
25
2.8k
Producing Creativity
orderedlist
PRO
340
39k
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