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
40
Public_Speaking.pdf
jimholmes
0
55
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
39
Is Quality The Bottleneck?
jimholmes
0
88
Don't Fear Leadership
jimholmes
0
55
Intro To TDD
jimholmes
1
48
Honor Flight #20 (Bay Area) Recap
jimholmes
0
97
Other Decks in Technology
See All in Technology
o1のAPIで実験してみたが 制限きつすぎて辛かった話
pharma_x_tech
0
220
Agile in Automotive Industry, puzzles and lights.
hiranabe
3
1.4k
より快適なエラーログ監視を目指して
leveragestech
4
1.5k
『GRANBLUE FANTASY Relink』キャラクターの魅力を支えるリグ・シミュレーション制作事例
cygames
0
150
JEP 480: Structured Concurrency
aya_ebata
0
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
46k
サプライチェーン攻撃に備える
ryunen344
0
340
学術機関におけるID連携とOpenID Connect
fujie
0
300
Oracle Autonomous Database:サービス概要のご紹介
oracle4engineer
PRO
1
7.1k
株式会社EventHub・エンジニア採用資料
eventhub
0
3k
LINEヤフーのフロントエンド組織・体制の紹介
lycorp_recruit_jp
1
1.2k
DroidKaigi 2024 たすけて!ViewModel
mhidaka
5
1k
Featured
See All Featured
Designing with Data
zakiwarfel
98
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Music & Morning Musume
bryan
46
6k
A Philosophy of Restraint
colly
202
16k
Building Adaptive Systems
keathley
36
2.1k
The Pragmatic Product Professional
lauravandoore
31
6.2k
We Have a Design System, Now What?
morganepeng
48
7.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
227
52k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
Building an army of robots
kneath
302
42k
Fontdeck: Realign not Redesign
paulrobertlloyd
80
5.1k
Become a Pro
speakerdeck
PRO
22
4.9k
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