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
15
Public_Speaking.pdf
jimholmes
0
42
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
37
Is Quality The Bottleneck?
jimholmes
0
83
Don't Fear Leadership
jimholmes
0
44
Intro To TDD
jimholmes
1
42
Honor Flight #20 (Bay Area) Recap
jimholmes
0
97
Other Decks in Technology
See All in Technology
データベース02: データベースの概念
trycycle
0
180
Documentação de Produtos: Artefatos essenciais na prática
rigolon
1
170
One engineer company with Ruby on Rails
rstankov
2
440
Gradle Build Scanを使ってビルドのことを知ろう potatotips #87
tomorrowkey
2
160
How to Lead? Testimonial of a Lead Android Engineer
oleur
1
110
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
160
Handling focus in 2024
tahia910
0
240
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
150
エンジニア候補者向け資料2024.04.24.pdf
macloud
0
3.4k
Cypress or Playwright?
rainerhahnekamp
0
180
Gitlab本から学んだこと - そーだいなるプレイバック / gitlab-book
soudai
7
1.3k
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Musicを例に~
otanet
0
310
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
9
1.3k
The Cost Of JavaScript in 2023
addyosmani
21
3.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Clear Off the Table
cherdarchuk
85
310k
Typedesign – Prime Four
hannesfritz
36
2.1k
It's Worth the Effort
3n
180
27k
Docker and Python
trallard
35
2.7k
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