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
WebDriver that Won't Drive You Crazy
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Jim Holmes
April 30, 2018
Programming
180
0
Share
WebDriver that Won't Drive You Crazy
Workshop for StarEast and Romainian Testing Conference
Jim Holmes
April 30, 2018
More Decks by Jim Holmes
See All by Jim Holmes
Adapting to Change in Software Delivery
jimholmes
0
100
Public_Speaking.pdf
jimholmes
0
140
Trusted System Boundaries
jimholmes
0
130
What's Worse? Zombies or Brittle UI Tests?
jimholmes
0
150
Odd Parallels Between Weightlifting and Software Delivery
jimholmes
0
73
Is Quality The Bottleneck?
jimholmes
0
150
Don't Fear Leadership
jimholmes
0
120
Intro To TDD
jimholmes
1
100
Honor Flight #20 (Bay Area) Recap
jimholmes
0
160
Other Decks in Programming
See All in Programming
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
470
Oxcを導入して開発体験が向上した話
yug1224
4
280
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
180
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
440
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
700
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.5k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
340
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.4k
AIとRubyの静的型付け
ukin0k0
0
530
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
470
New Earth Scene 8
popppiees
3
2.3k
Become a Pro
speakerdeck
PRO
31
6k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The SEO identity crisis: Don't let AI make you average
varn
0
480
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
210
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
Transcript
WebDriver That Won’t Drive You Crazy
Get Latest Slides At http://speakerdeck.com/ jimholmes
Jim Holmes
[email protected]
github.com/jimholmes @aJimHolmes
Logistics
Time Exercises Breaks Backlog
Disclaimers
I’m not an expert
I’m “seasoned”
My workshops are collaborative
Stuff WILL Break
Goals
There Are No “Best Practices”
Know the fundamentals
Test the right things
Get the right coverage
Write good code
You
What are Two Things you hope to learn?
Opening Exercises
What does “Quality” mean to you?
If Testing were a sport, what sport would it be?
Thanks to Karen Greaves and Samantha Laing A Coach’s Guide
to Agile Testing https://leanpub.com/AgileTesting
What’s Our Job?
Who guarantees “quality” ??
Risk
Value
Risk and Value guide all our tests. ESPECIALLY WebDriver tests
Types of Testing
“test” versus “check”
Any failure is a starting point
Unit Tests
40 hours TIMES $20 per hour EQUALS $800
Integration (or Service) Tests
Using Postman When I call the create item web service
with a new item service template Then the item shows up in the database
User Interface (or end-to-end)
(NOT “just” testing of JavaScript in browser)
Using any of our supported browsers And I don’t have
anything in my cart When I add bacon, tires, and a frog to my cart Then I will see those items in my cart
Exploratory Testing
Using SQL Injection, malformed data, and oversized data I’m going
to explore the search product screens For 45 minutes To see what interesting (and scary!) stuff I can find
https://martinfowler.com/articles/practical-test-pyramid.html
https://twitter.com/noahsussman/status/836612175707930625
Box of rocks
There are no ‘best practices’ There is no ‘one testing
ring to rule them all’
Security Accessibility Scalability Performance Usability Compliance Mom
Demo What it looks like running together
Working With Risk
Setup
Repository https://github.com/ jimholmes/ SaneWebDriver-CSharp SaneWebDriver-Java
None
First run in Eclipse
First run in Visual Studio
Overview
Components WebDriver APIs Drivers Frameworks Libraries Tools
Browser
Browser WebDriver
Browser WebDriver
IWebDriver browser = new FirefoxDriver(); browser.Navigate().GoToUrl(“SOMEPLACE”);
WebDriver Bindings Support Classes .NET Java Ruby Python JavaScript Perl
blah blah blah blah WebDriverWait ExpectedConditions etc. +
Host System Browser WebDriver Bindings + support classes
Host System Browser WebDriver Bindings + support classes Driver ChromeDriver,
eg
Host System Browser WebDriver Bindings + support classes Driver ChromeDriver,
eg
Host System Browser WebDriver Bindings + support classes Driver ChromeDriver,
eg
Host System Browser WebDriver Bindings + support classes Driver ChromeDriver,
eg
Host System Browser WebDriver Bindings + support classes Driver ChromeDriver,
eg
Host System Browser WebDriver
Host System Browser WebDriver Driver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System Browser WebDriver Driver Remote WebDriver
Host System WebDriver Selenium Server or Grid Host System Browser
Driver Remote WebDriver
Host System Browser Driver Remote WebDriver Test Framework WebDriver Selenium
Server or Grid
Assert.IsNotNullOrEmpty( grid.FindElement( By.CssSelector(SOME_ELEMENT)).Text);
Test Framework Browser WebDriver Driver
Language Framework Test Framework Browser WebDriver Driver
GIVEN I am logged on as a Salesperson WHEN I
create a new lead THEN that contact appears only in my leads
Maintainability
Your Test Suite should NOT BE
“flaky”
Require lots of time to change or fix
Your Test Suite SHOULD BE
Valuable
Reliable
Trustworthy
Easy to Change
How to get there
Team With the Developers
Small Steps
Think Before You Code
The best code you write is that which you don’t
Refactor
Code can be like poetry
Think Plan Fail Learn Fail Less
WebDriver 101
The Basics
Test Layout: Arrange Act Assert
Test One Thing
Locators
IDs CSS Selectors XPath
Async
What is Async?
How do we avoid it driving us insane?
Write the First Test
Is the Grid there?
Refactor
Setup / Teardown
Refactor Again
Page Objects Know the page Not the test
Clean Tests Know the test Not the page
SRP Test/do one thing (and do it well)
DRY/moist Don’t Repeat Yourself (except where it makes sense)
More Advanced Concepts
Understand Coverage
What Tests Do We Need?
Walkthrough: Unit and Integration
Backing APIs
Use Helper Libraries
Team With the Developers
Test Data Setup
Testable Systems
Own the System Code? USE THAT POWER!
Hack the UI
Locators Custom IDs
Async flags
Better Tests
Hack the System
Feature Toggles Mock Services
Better Tests
Now What?
Factories Configuration Lifecycle Management
https://thefriendlytester.co.uk/2014/02/webdriver-factory.html
CI/CD
Cloud
Discussion: Parameterizing for Different Envs
Parallel
None
Parallelization Solves Everything!
Parallelization Solves Everything!
None
Parallelization Solves Everything!
Fix Your Dang System!
bit.ly/3HoursTo3Mins
Discussion: Test Stability in Parallel Execution
Takeaways
None
Automate High-Value, High Risk
Avoid Overlapping Coverage
Test Code is Production Code
Manage Your Data
Build Out APIs
Avoid End-To-End
Parallelization as LAST RESORT
bit.ly/leadershipjourney
A Couple Closing Remarks
0) No SharePoint
B) Hug your loved ones RIGHT NOW
THANK YOU