MB
Full-day Tutorials
Monday, April 30th, 2018
8:30 AM
Develop WebDriver Automated Tests—
and Keep Your Sanity
Presented by:
Jim Holmes
Guidepost Systems
Brought to you by:
350 Corporate Way, Suite 400, Orange Park, FL 32073
888---268---8770 ·· 904---278---0524 - info@techwell.com - http://www.stareast.techwell.com/
Jim Holmes
Guidepost Systems
Jim Holmes is an executive consultant at Pillar Technology where he works with
organizations to improve their software delivery process. he is also the
owner/principal of Guidepost Systems which lets him engage directly with
struggling organizations. Since joining the US Air Force in 1982, Jim has been in
various corners of the IT world. He has worked with organizations—ranging from
start-ups to Fortune 10 companies—to improve their delivery processes and ship
better value to their customers. When not at work, you may find Jim in the
kitchen with a glass of wine, playing Xbox, hiking with his family, or banished to
the garage while practicing his guitar.
WebDriver That
Won’t Drive
You Crazy
Get Latest
Slides At
http://speakerdeck.com/
jimholmes
Jim Holmes
jim@GuidePostSystems.com
github.com/jimholmes
@aJimHolmes
Logistics
Time
Exercises
Breaks
Backlog
Goals
There Are No
“Best
Practices”
Test the right
things
Get the right
coverage
Know the
fundamentals
Write good
code
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)
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
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
First run in
Eclipse
First run in
Visual Studio
Overview
Components
WebDriver APIs
Drivers
Frameworks
Libraries
Tools
Browser
BrowserWebDriver
BrowserWebDriver
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.
+
HostSystem
Browser
WebDriver
Bindings +
support classes
HostSystem
Browser
WebDriver
Bindings +
support classes
Driver
ChromeDriver, eg
HostSystem
Browser
WebDriver
Bindings +
support classes
Driver
ChromeDriver, eg
HostSystem
Browser
WebDriver
Bindings +
support classes
Driver
ChromeDriver, eg
HostSystem
Browser
WebDriver
Bindings +
support classes
Driver
ChromeDriver, eg
HostSystem
Browser
WebDriver
Bindings +
support classes
Driver
ChromeDriver, eg
HostSystem
Browser
WebDriver
HostSystem
Browser
WebDriver
Driver
HostSystem
Browser
WebDriver
Driver
Remote
WebDriver
HostSystem
Browser
WebDriver
Driver
Remote
WebDriverHostSystem
Browser
WebDriver
Driver
Remote
WebDriver
HostSystem
Browser
WebDriver
Driver
Remote
WebDriverHostSystem
Browser
WebDriver
Driver
Remote
WebDriver
HostSystem
Browser
WebDriver
Driver
Remote
WebDriverHostSystem
Browser
WebDriver
Driver
Remote
WebDriver
HostSystem
WebDriver
Selenium
Server or
Grid HostSystem
Browser
Driver
Remote
WebDriverHostSystem
Browser
Driver
Remote
WebDriver
Test
Framework
WebDriver
Selenium
Server or
Grid
Assert.IsNotNullOrEmpty(	
grid.FindElement(	
By.CssSelector(SOME_ELEMENT)).Text);
Test Framework
BrowserWebDriver
Driver
Language Framework
Test Framework
BrowserWebDriver
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
you don’t
Refactor
Code can be
like poetry
Think
Plan
Fail
Learn
Fail Less
WebDriver
101
The
Basics
Locators
Async
Write the First
Test
Refactor
Page Objects
Clean Tests
SRP
DRY/moist
Refactor
Again
More
Advanced
Concepts
Team With the
Developers
Backing APIs
Use Helper
Libraries
Testable
Systems
Own the System
Code?
USE THAT
POWER!
Hack the
UI
Locators
Custom IDs
Better Tests
Hack the
System
Feature
Toggles
Mock Services
Better Tests
Now
What?
CI/CD
Cloud
Parallel
Parallelization Solves
Everything!
Parallelization Solves
Everything!
Parallelization Solves
Everything!
Fix Your Dang System!
bit.ly/3HoursTo3Mins
Takeaways
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
0) No SharePoint
B) Hug your loved
ones
RIGHT NOW
THANK
YOU

Develop WebDriver Automated Tests—and Keep Your Sanity