SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
But I Know What I Like
Abstraction is the Key to Automation
(@dylanlacey -- Sauce Labs)
Preheat the oven to 375 Degrees
Cream 250g of butter and 1 cup of sugar
in a mixing bowl
Mix in 2 cups of flour and 1 cup of milk,
and combine
Mix in 2 tsp of vanilla extract
Pour into prepared tins and bake 1 hour
•
•
•
•
•
The Exhausting Reality
Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit
Place 250g of butter into the bowl of a mixer
Place 1 cup of sugar into the same bowl
Turn the mixer onto “7”
Mix until the mixture is pale yellow
Turn the Mixer down to “1”
Add 2 cups of flour to the mixing bowl
Add 1 cup of milk to the mixing bowl
Allow the mixer to run until the mixture looks the same colour throughout
Add 2tsp of Vanilla to the mixing bowl
•
•
•
•
•
•
•
•
•
•
The Exhausting Reality
Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit
Place a bowl on a scale
Turn the scale on by pressing the “on” button
Use a knife to cut a stick of butter into 100 slices
Place one slice into the bowl on the scale
Read the Scale
Continue to place slices of butter into the bowl until the scale reads ‘250g’
Open a container of sugar
Get a dry cup measure from the drawer
Scoop sugar from the container into the measuring cup until it reaches the top
of the cup
Draw the back of a knife across the surface of the measuring cup, allowing the
excess sugar to fall back into the canister
Place the measuring cup on the counter
Take the mixer out of the cupboard
Place the mixer on the bench
Insert the square blade into the right hand blade hole on the mixer
Insert the round blade into the left hand blade hole on the mixer
The Exhausting Reality
Being Specific is Reliable
PFFT WHATEVER
You Have Questions.
Who is this loudmouth?
Why am I even listening to him?
What time is Morning Tea?
Gee I love bacon.
•
•
•
•
Who is this guy?
What is he talking
about?
What is a Good Abstraction?
How Abstraction makes for Automation
Abstraction of Scripts
Abstraction of Infrastructure
•
•
•
•
What Are
Abstractions?
Good Abstractions Are:
Not “Leaky”
Understanding Enhancing
(For our purposes) Shareable
•
•
•
Abstraction is Totes
Great
Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit
Place a bowl on a scale
Turn the scale on by pressing the “on” button
Use a knife to cut a stick of butter into 100 slices
Place one slice into the bowl on the scale
Read the Scale
Continue to place slices of butter into the bowl until the scale reads ‘250g’
Open a container of sugar
Get a dry cup measure from the drawer
Scoop sugar from the container into the measuring cup until it reaches the top
of the cup
Draw the back of a knife across the surface of the measuring cup, allowing the
excess sugar to fall back into the canister
Place the measuring cup on the counter
Take the mixer out of the cupboard
Place the mixer on the bench
Insert the square blade into the right hand blade hole on the mixer
Insert the round blade into the left hand blade hole on the mixer
The Exhausting Reality
Actually, screw cake.
Go to Chucks
Drink a Lowenbrau Dunkel
Take a shot of Tequila
Drink a White Rabbit Pale Ale
Take a sip of Natural Ice
Grimace and Skoll The Rest
Wash it out with a Stein of
Wiheinstephaner
Sleep in a doorway
•
•
•
•
•
•
•
•
Go to Chucks
Drink a Lowenbrau Dunkel
Take a shot of Tequila
Drink a White Rabbit Pale Ale
Take a sip of Natural Ice
Grimace and Skoll The Rest
Wash it out with a Stein of
Wiheinstephaner
Sleep in a doorway
Experience Regret
•
•
•
•
•
•
•
•
•
Go to Chucks
Drink 4 Beers
Take a shot
Sleep in a doorway
Experience Regret
•
•
•
•
•
Abstraction for
Scripts
Maintenance
(Easier)
Creation
(Faster)
/
Abstraction for
Infrastructure
Execution
(Faster)
Maintenance
(Easier)
/
TESTING
IS ALREADY
ABSTRACTION
Abstraction for
Scripting
(2ish minutes of PageObjects)
PageObjects are
Abstract
Methods for “Doin’ Stuff” on a page
Should return Page Objects when giving
new pages
Encapsulate functionality and provide
single-line access to tasks
Ruby has SitePrism, page_objects_gem
•
•
•
•
Abstraction for
Scripting
(15 minutes of Capybara)
Go to Chucks
Drink a Lowenbrau Dunkel
Take a shot of Tequila
Drink a White Rabbit Pale Ale
Take a sip of Natural Ice
Grimace and Skoll The Rest
Wash it out with a Stein of
Wiheinstephaner
Sleep in a doorway
Experience Regret
•
•
•
•
•
•
•
•
•
Go to Chucks
Drink 4 Beers
Take a shot
Sleep in a doorway
Experience Regret
•
•
•
•
•
That’s what Capybara
does. No, really.
Capybara for Everyone!
Free, open source tool, widely used by
the Ruby Community
Able to run “headless” for JS-free testing
Able to use Selenium to drive browsers
•
•
•
Capybara Basics
find_xpath ‘//table tr’
find_css ‘table.tr.beer’
find_field(‘mixer’).value
find(#pantry).find(‘vermouth’)
•
•
•
•
Capybara Basics
has_css? ‘#sobriety’
has_xpath? ‘//table tr’
has_content? ‘shaken’
•
•
•
Capybara Basics
click_link ‘http://www.hendricksgin.com’
click_button ‘skoll’
click_on ‘blender’
•
•
•
Capybara exact &
match
Capybara.exact = true
All future matches must be exact
Default false -> Gin matches Gin and Tonic
click_link(“jigger”, exact: true)
Capybara.match = prefer_exact
Sets strategy for multiple matches
Default ‘smart’, also one, first, prefer_exact
click_link(“shout”, match: one)
Capybara with Forms
visit ‘/login’
fill_in ‘first_name’, :with => “Dylan”
fill_in ‘last_name’, :with => “Lacey”
select(‘Ruby’), :from => “Languages”
check ‘Awesome’
attach_file(‘Beer’, ‘/Path/To/Beer’)
Scopes Save you from
Selector Hell
within ‘party’ do
fill_in :pint, :with => “Kilkenny”
end
find(‘#barfridge’).click_link ‘open’
Human Readable?
Human Readable.
Abstraction for
Scripting
(15 minutes of Cucumber)
Write Tests In
Engl“ish”
(Technically it’s ‘gherkin’)
Scenario: I am Sober
Given I am on http://en.wikipedia.org/wiki/Main_Page
When I enter "Old Fashioned" into the search box
And I click the searchButton
Then I should see "The Old Fashioned is an IBA Official Cocktail"
It’s not Magic
Features in Gherkin are implemented by
‘step definitions’
You/r team write the step definitions
Step definitions can be any code
Step definitions can be many programming
languages
•
•
•
•
That feature SUCKED
Scenario: I am Sober
Given I am on Wikipedia’s Main Page
When I search for “Old Fashioned”
Then I should see the “Old Fashioned” entry
Abstractions Allow
Maintenance
Given there is a user Jack
And Jack owns a brewery
And Jack has a paid account
And Jack enters his password
And Jack enters his username
When he logs in
Then I should take a shot BRITTLE
Abstractions Allow
Maintenance
When A Brewer Logs In
Then I should take a shot
AWESOME
Don’t Hide Too MuchBackgrounds => Steps run before each feature
background:
Given Jack is a Brewer
And Jack has not paid his bill
Scenario: Jack orders something delicious
When Jack orders Woodford Reserve
Then Jack sees “Shove Off”
Scenario: Jack orders something gross
When Jack orders Tequila
Then Jack sees “This time, but pay up!”
Cucumber means
making nice with
Developers
Developer Facts:
Developers get really involved in their
work
We’re sorry about the time we got mad
at you for that one thing
Developers want the same thing you
want: Better Product
Y’all are as smart as them, if not smarter
(don’t tell them I said that)
•
•
•
•
Sell to Developers:
You’re both focused on Customer Quality
You both want to do excellent work
“My Job is to make *YOU* look good”
(Thanks, JeanAnn Harrison!)
•
•
•
Test + Dev with Cuke
Work together to build good tests
Devs give step support and get tests and
diagnostics
Testers give expert advice and get flexible
tools
You can use different dev & test languages
DANGER: Don’t let the devs make setup
•
•
•
•
•
Abstraction for
Infrastructure
Execution
(Faster)
Maintenance
(Easier)
/
Selenium requires
ALL THE THINGS
Chrome, Safari, Opera,
IE, Firefox
MULTIPLIED BY
Mac 10.8, Windows
XP/7/8, Linux, iOS?!
MULTIPLIED BY
Versions!
•
•
•
Make it someone else’s
problem
Selenium Grid
Virtual Machines
Third Party Services
•
•
•
Selenium Grid
CHEAP EASY FAST
To Obtain
To Operate
To Distribute
To Parallelize
To Setup
To Deploy
(EC2)
(Abstract Browsers)
I <3 VMs
CHEAP EASY FAST
To Run
To Replicate
To Share
To Restore
To Update
To Backup
To Duplicate
To Setup
To Destroy
(Abstract Computers)
Why Not Both?
Easy Parallelization
Platforms you otherwise can’t support
Significantly lower staff & infrastructure
costs
•
•
•
3rd Party Services
CHEAP EASY FAST
Capacity
Xtra Features (?)
Maintenance
Integration (?)
Updating
Team Work (?)
Access To New
Paralleling (?)
CI
(Abstract Solutions)
(?) = Dependant on Provider?
Selenium Grid
+
3rd Party VMs
=
Parallel Heaven
Abstraction for
Infrastructure
Bonus!
Appium
Appium
(Abstract ...Devices?!)
Native App Automation with
Selenium
Any Selenium Webdriver Tool
No App modifications
Totally Free and Open Source!
(Mac client only ATM. Sorry >.>)
How to Appium
Download and Install Appium from
http://www.appium.io
Run Appium with your App
Write your tests using the Selenium
Webdriver JSON Subset:
https://github.com/appium/appium/wiki/JSON-
Wire-Protocol:-Supported-Methods
Run your tests
•
•
•
•
WAAAAA I Don’t
Have a Mac!
Contributes to the
Appium Project
Runs Appium in their
Cloud
Is working on
Android support
•
•
•
Questions?
(@dylanlacey)
(dylan@saucelabs.com)
Resources
Play with Sauce Labs:
1000 Manual Minutes
200 Automated Minutes
Promo Code: TestLearnPlay (exp
3/14)
Our Blog: http://www.sauceio.com
•
•
•
•
•
Tools & Links
Capybara: https://github.com/jnicklas/capybara
Cucumber: http://cukes.info/
Appium: http://appium.io/
Supported methods: http://goo.gl/MiPcH
Ruby examples: http://goo.gl/uQGh5
Sauce Labs Sign Up: http://goo.gl/uBTXX
•
•
•
•
•
•

Weitere ähnliche Inhalte

Ähnlich wie But I Know What I Like: Abstraction is the Key to Automation

Sourdough: Hacking Bread and Social Baking (for non hackers)
Sourdough: Hacking Bread and Social Baking (for non hackers)Sourdough: Hacking Bread and Social Baking (for non hackers)
Sourdough: Hacking Bread and Social Baking (for non hackers)Guilherme Zühlke O'Connor
 
ChefConf 2015 - Chef Retrospective
ChefConf 2015 - Chef RetrospectiveChefConf 2015 - Chef Retrospective
ChefConf 2015 - Chef Retrospectivegwaldo
 
3 Copywriting Tips for (Confused) Technical Writers
3 Copywriting Tips for (Confused) Technical Writers3 Copywriting Tips for (Confused) Technical Writers
3 Copywriting Tips for (Confused) Technical WritersTWi
 
Aesthetic December Daily Calendar.pptx
Aesthetic December Daily Calendar.pptxAesthetic December Daily Calendar.pptx
Aesthetic December Daily Calendar.pptxnrodriguez601
 
Retro Daily Calendar.pptx
Retro Daily Calendar.pptxRetro Daily Calendar.pptx
Retro Daily Calendar.pptxWilliamRH2
 
Educ416 week four_assignment
Educ416 week four_assignmentEduc416 week four_assignment
Educ416 week four_assignmentKathie Sedwick
 
Teaching With Power Point
Teaching With Power PointTeaching With Power Point
Teaching With Power Pointtams
 
Grab this 80 Cakes Tips at Home
Grab this 80 Cakes Tips at HomeGrab this 80 Cakes Tips at Home
Grab this 80 Cakes Tips at HomeRiyaRao10
 
BarCamp Homebrew Presentation Final (No Transitions)
BarCamp Homebrew Presentation Final (No Transitions)BarCamp Homebrew Presentation Final (No Transitions)
BarCamp Homebrew Presentation Final (No Transitions)Matthew Lamb
 
Keya Product
Keya ProductKeya Product
Keya Productkeya1295
 
Never too young for Kaizen
Never too young for KaizenNever too young for Kaizen
Never too young for KaizenRod Smith
 
how to make chocolate chip cookies
how to make chocolate chip cookieshow to make chocolate chip cookies
how to make chocolate chip cookiesFortuna Lu
 
A Dickens of A Keynote
A Dickens of A KeynoteA Dickens of A Keynote
A Dickens of A KeynoteJames Gray
 
Branding by Sally Coleman
Branding by Sally ColemanBranding by Sally Coleman
Branding by Sally ColemanNathalie Alpi
 
Homebrew 101
Homebrew 101Homebrew 101
Homebrew 101Gil Lopez
 
Startupfest 2016: MARTY WEINER (Reddit) - How to
Startupfest 2016: MARTY WEINER (Reddit) - How toStartupfest 2016: MARTY WEINER (Reddit) - How to
Startupfest 2016: MARTY WEINER (Reddit) - How toStartupfest
 
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At Scale
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At ScaleMarty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At Scale
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At ScaleDiana Chow
 

Ähnlich wie But I Know What I Like: Abstraction is the Key to Automation (20)

Sourdough: Hacking Bread and Social Baking (for non hackers)
Sourdough: Hacking Bread and Social Baking (for non hackers)Sourdough: Hacking Bread and Social Baking (for non hackers)
Sourdough: Hacking Bread and Social Baking (for non hackers)
 
ChefConf 2015 - Chef Retrospective
ChefConf 2015 - Chef RetrospectiveChefConf 2015 - Chef Retrospective
ChefConf 2015 - Chef Retrospective
 
3 Copywriting Tips for (Confused) Technical Writers
3 Copywriting Tips for (Confused) Technical Writers3 Copywriting Tips for (Confused) Technical Writers
3 Copywriting Tips for (Confused) Technical Writers
 
Aesthetic December Daily Calendar.pptx
Aesthetic December Daily Calendar.pptxAesthetic December Daily Calendar.pptx
Aesthetic December Daily Calendar.pptx
 
Retro Daily Calendar.pptx
Retro Daily Calendar.pptxRetro Daily Calendar.pptx
Retro Daily Calendar.pptx
 
Practical PowerPoint
Practical PowerPointPractical PowerPoint
Practical PowerPoint
 
Educ416 week four_assignment
Educ416 week four_assignmentEduc416 week four_assignment
Educ416 week four_assignment
 
Teaching With Power Point
Teaching With Power PointTeaching With Power Point
Teaching With Power Point
 
Grab this 80 Cakes Tips at Home
Grab this 80 Cakes Tips at HomeGrab this 80 Cakes Tips at Home
Grab this 80 Cakes Tips at Home
 
BarCamp Homebrew Presentation Final (No Transitions)
BarCamp Homebrew Presentation Final (No Transitions)BarCamp Homebrew Presentation Final (No Transitions)
BarCamp Homebrew Presentation Final (No Transitions)
 
Keya s
Keya sKeya s
Keya s
 
Keya Product
Keya ProductKeya Product
Keya Product
 
Growth meetup-q4-2014
Growth meetup-q4-2014Growth meetup-q4-2014
Growth meetup-q4-2014
 
Never too young for Kaizen
Never too young for KaizenNever too young for Kaizen
Never too young for Kaizen
 
how to make chocolate chip cookies
how to make chocolate chip cookieshow to make chocolate chip cookies
how to make chocolate chip cookies
 
A Dickens of A Keynote
A Dickens of A KeynoteA Dickens of A Keynote
A Dickens of A Keynote
 
Branding by Sally Coleman
Branding by Sally ColemanBranding by Sally Coleman
Branding by Sally Coleman
 
Homebrew 101
Homebrew 101Homebrew 101
Homebrew 101
 
Startupfest 2016: MARTY WEINER (Reddit) - How to
Startupfest 2016: MARTY WEINER (Reddit) - How toStartupfest 2016: MARTY WEINER (Reddit) - How to
Startupfest 2016: MARTY WEINER (Reddit) - How to
 
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At Scale
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At ScaleMarty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At Scale
Marty Weiner, Reddit CTO @ SXSWi 2016 - Everything's Harder At Scale
 

Mehr von Sauce Labs

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSauce Labs
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesSauce Labs
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleSauce Labs
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumSauce Labs
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingSauce Labs
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationSauce Labs
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) TestingSauce Labs
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsSauce Labs
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionSauce Labs
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartSauce Labs
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.ioSauce Labs
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Sauce Labs
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterSauce Labs
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingSauce Labs
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...Sauce Labs
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test AutomationSauce Labs
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs
 
BDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu PetetiBDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu PetetiSauce Labs
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Sauce Labs
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaSauce Labs
 

Mehr von Sauce Labs (20)

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) Testing
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product Obsession
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous Testing
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software Testing
 
BDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu PetetiBDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu Peteti
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa Benua
 

Kürzlich hochgeladen

Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfDanny Diep To
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifeBhavana Pujan Kendra
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024Adnet Communications
 
Psychic Reading | Spiritual Guidance – Astro Ganesh Ji
Psychic Reading | Spiritual Guidance – Astro Ganesh JiPsychic Reading | Spiritual Guidance – Astro Ganesh Ji
Psychic Reading | Spiritual Guidance – Astro Ganesh Jiastral oracle
 
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdftrending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdfMintel Group
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
20200128 Ethical by Design - Whitepaper.pdf
20200128 Ethical by Design - Whitepaper.pdf20200128 Ethical by Design - Whitepaper.pdf
20200128 Ethical by Design - Whitepaper.pdfChris Skinner
 
Healthcare Feb. & Mar. Healthcare Newsletter
Healthcare Feb. & Mar. Healthcare NewsletterHealthcare Feb. & Mar. Healthcare Newsletter
Healthcare Feb. & Mar. Healthcare NewsletterJamesConcepcion7
 
Excvation Safety for safety officers reference
Excvation Safety for safety officers referenceExcvation Safety for safety officers reference
Excvation Safety for safety officers referencessuser2c065e
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFChandresh Chudasama
 
Jewish Resources in the Family Resource Centre
Jewish Resources in the Family Resource CentreJewish Resources in the Family Resource Centre
Jewish Resources in the Family Resource CentreNZSG
 
Appkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxAppkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxappkodes
 
Data Analytics Strategy Toolkit and Templates
Data Analytics Strategy Toolkit and TemplatesData Analytics Strategy Toolkit and Templates
Data Analytics Strategy Toolkit and TemplatesAurelien Domont, MBA
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Americas Got Grants
 
WSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfWSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfJamesConcepcion7
 
NAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataNAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
EUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersEUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersPeter Horsten
 

Kürzlich hochgeladen (20)

Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in Life
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024
 
Psychic Reading | Spiritual Guidance – Astro Ganesh Ji
Psychic Reading | Spiritual Guidance – Astro Ganesh JiPsychic Reading | Spiritual Guidance – Astro Ganesh Ji
Psychic Reading | Spiritual Guidance – Astro Ganesh Ji
 
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdftrending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
20200128 Ethical by Design - Whitepaper.pdf
20200128 Ethical by Design - Whitepaper.pdf20200128 Ethical by Design - Whitepaper.pdf
20200128 Ethical by Design - Whitepaper.pdf
 
Healthcare Feb. & Mar. Healthcare Newsletter
Healthcare Feb. & Mar. Healthcare NewsletterHealthcare Feb. & Mar. Healthcare Newsletter
Healthcare Feb. & Mar. Healthcare Newsletter
 
Excvation Safety for safety officers reference
Excvation Safety for safety officers referenceExcvation Safety for safety officers reference
Excvation Safety for safety officers reference
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDF
 
Jewish Resources in the Family Resource Centre
Jewish Resources in the Family Resource CentreJewish Resources in the Family Resource Centre
Jewish Resources in the Family Resource Centre
 
Appkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxAppkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptx
 
Data Analytics Strategy Toolkit and Templates
Data Analytics Strategy Toolkit and TemplatesData Analytics Strategy Toolkit and Templates
Data Analytics Strategy Toolkit and Templates
 
WAM Corporate Presentation April 12 2024.pdf
WAM Corporate Presentation April 12 2024.pdfWAM Corporate Presentation April 12 2024.pdf
WAM Corporate Presentation April 12 2024.pdf
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...
 
WSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfWSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdf
 
NAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataNAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors Data
 
EUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exportersEUDR Info Meeting Ethiopian coffee exporters
EUDR Info Meeting Ethiopian coffee exporters
 

But I Know What I Like: Abstraction is the Key to Automation

  • 1. But I Know What I Like Abstraction is the Key to Automation (@dylanlacey -- Sauce Labs)
  • 2. Preheat the oven to 375 Degrees Cream 250g of butter and 1 cup of sugar in a mixing bowl Mix in 2 cups of flour and 1 cup of milk, and combine Mix in 2 tsp of vanilla extract Pour into prepared tins and bake 1 hour • • • • • The Exhausting Reality
  • 3. Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit Place 250g of butter into the bowl of a mixer Place 1 cup of sugar into the same bowl Turn the mixer onto “7” Mix until the mixture is pale yellow Turn the Mixer down to “1” Add 2 cups of flour to the mixing bowl Add 1 cup of milk to the mixing bowl Allow the mixer to run until the mixture looks the same colour throughout Add 2tsp of Vanilla to the mixing bowl • • • • • • • • • • The Exhausting Reality
  • 4. Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit Place a bowl on a scale Turn the scale on by pressing the “on” button Use a knife to cut a stick of butter into 100 slices Place one slice into the bowl on the scale Read the Scale Continue to place slices of butter into the bowl until the scale reads ‘250g’ Open a container of sugar Get a dry cup measure from the drawer Scoop sugar from the container into the measuring cup until it reaches the top of the cup Draw the back of a knife across the surface of the measuring cup, allowing the excess sugar to fall back into the canister Place the measuring cup on the counter Take the mixer out of the cupboard Place the mixer on the bench Insert the square blade into the right hand blade hole on the mixer Insert the round blade into the left hand blade hole on the mixer The Exhausting Reality
  • 5.
  • 6. Being Specific is Reliable
  • 8. You Have Questions. Who is this loudmouth? Why am I even listening to him? What time is Morning Tea? Gee I love bacon. • • • •
  • 9. Who is this guy?
  • 10. What is he talking about? What is a Good Abstraction? How Abstraction makes for Automation Abstraction of Scripts Abstraction of Infrastructure • • • •
  • 12. Good Abstractions Are: Not “Leaky” Understanding Enhancing (For our purposes) Shareable • • •
  • 14. Set the Temperature Dial of the Oven to 375 Degrees Fahrenheit Place a bowl on a scale Turn the scale on by pressing the “on” button Use a knife to cut a stick of butter into 100 slices Place one slice into the bowl on the scale Read the Scale Continue to place slices of butter into the bowl until the scale reads ‘250g’ Open a container of sugar Get a dry cup measure from the drawer Scoop sugar from the container into the measuring cup until it reaches the top of the cup Draw the back of a knife across the surface of the measuring cup, allowing the excess sugar to fall back into the canister Place the measuring cup on the counter Take the mixer out of the cupboard Place the mixer on the bench Insert the square blade into the right hand blade hole on the mixer Insert the round blade into the left hand blade hole on the mixer The Exhausting Reality
  • 16. Go to Chucks Drink a Lowenbrau Dunkel Take a shot of Tequila Drink a White Rabbit Pale Ale Take a sip of Natural Ice Grimace and Skoll The Rest Wash it out with a Stein of Wiheinstephaner Sleep in a doorway • • • • • • • •
  • 17. Go to Chucks Drink a Lowenbrau Dunkel Take a shot of Tequila Drink a White Rabbit Pale Ale Take a sip of Natural Ice Grimace and Skoll The Rest Wash it out with a Stein of Wiheinstephaner Sleep in a doorway Experience Regret • • • • • • • • • Go to Chucks Drink 4 Beers Take a shot Sleep in a doorway Experience Regret • • • • •
  • 22. PageObjects are Abstract Methods for “Doin’ Stuff” on a page Should return Page Objects when giving new pages Encapsulate functionality and provide single-line access to tasks Ruby has SitePrism, page_objects_gem • • • •
  • 24. Go to Chucks Drink a Lowenbrau Dunkel Take a shot of Tequila Drink a White Rabbit Pale Ale Take a sip of Natural Ice Grimace and Skoll The Rest Wash it out with a Stein of Wiheinstephaner Sleep in a doorway Experience Regret • • • • • • • • • Go to Chucks Drink 4 Beers Take a shot Sleep in a doorway Experience Regret • • • • •
  • 26. Capybara for Everyone! Free, open source tool, widely used by the Ruby Community Able to run “headless” for JS-free testing Able to use Selenium to drive browsers • • •
  • 27. Capybara Basics find_xpath ‘//table tr’ find_css ‘table.tr.beer’ find_field(‘mixer’).value find(#pantry).find(‘vermouth’) • • • •
  • 28. Capybara Basics has_css? ‘#sobriety’ has_xpath? ‘//table tr’ has_content? ‘shaken’ • • •
  • 29. Capybara Basics click_link ‘http://www.hendricksgin.com’ click_button ‘skoll’ click_on ‘blender’ • • •
  • 30. Capybara exact & match Capybara.exact = true All future matches must be exact Default false -> Gin matches Gin and Tonic click_link(“jigger”, exact: true) Capybara.match = prefer_exact Sets strategy for multiple matches Default ‘smart’, also one, first, prefer_exact click_link(“shout”, match: one)
  • 31. Capybara with Forms visit ‘/login’ fill_in ‘first_name’, :with => “Dylan” fill_in ‘last_name’, :with => “Lacey” select(‘Ruby’), :from => “Languages” check ‘Awesome’ attach_file(‘Beer’, ‘/Path/To/Beer’)
  • 32. Scopes Save you from Selector Hell within ‘party’ do fill_in :pint, :with => “Kilkenny” end find(‘#barfridge’).click_link ‘open’
  • 36. Write Tests In Engl“ish” (Technically it’s ‘gherkin’) Scenario: I am Sober Given I am on http://en.wikipedia.org/wiki/Main_Page When I enter "Old Fashioned" into the search box And I click the searchButton Then I should see "The Old Fashioned is an IBA Official Cocktail"
  • 37. It’s not Magic Features in Gherkin are implemented by ‘step definitions’ You/r team write the step definitions Step definitions can be any code Step definitions can be many programming languages • • • •
  • 38. That feature SUCKED Scenario: I am Sober Given I am on Wikipedia’s Main Page When I search for “Old Fashioned” Then I should see the “Old Fashioned” entry
  • 39. Abstractions Allow Maintenance Given there is a user Jack And Jack owns a brewery And Jack has a paid account And Jack enters his password And Jack enters his username When he logs in Then I should take a shot BRITTLE
  • 40. Abstractions Allow Maintenance When A Brewer Logs In Then I should take a shot AWESOME
  • 41. Don’t Hide Too MuchBackgrounds => Steps run before each feature background: Given Jack is a Brewer And Jack has not paid his bill Scenario: Jack orders something delicious When Jack orders Woodford Reserve Then Jack sees “Shove Off” Scenario: Jack orders something gross When Jack orders Tequila Then Jack sees “This time, but pay up!”
  • 42. Cucumber means making nice with Developers
  • 43. Developer Facts: Developers get really involved in their work We’re sorry about the time we got mad at you for that one thing Developers want the same thing you want: Better Product Y’all are as smart as them, if not smarter (don’t tell them I said that) • • • •
  • 44. Sell to Developers: You’re both focused on Customer Quality You both want to do excellent work “My Job is to make *YOU* look good” (Thanks, JeanAnn Harrison!) • • •
  • 45. Test + Dev with Cuke Work together to build good tests Devs give step support and get tests and diagnostics Testers give expert advice and get flexible tools You can use different dev & test languages DANGER: Don’t let the devs make setup • • • • •
  • 47. Selenium requires ALL THE THINGS Chrome, Safari, Opera, IE, Firefox MULTIPLIED BY Mac 10.8, Windows XP/7/8, Linux, iOS?! MULTIPLIED BY Versions! • • •
  • 48. Make it someone else’s problem Selenium Grid Virtual Machines Third Party Services • • •
  • 49. Selenium Grid CHEAP EASY FAST To Obtain To Operate To Distribute To Parallelize To Setup To Deploy (EC2) (Abstract Browsers)
  • 50. I <3 VMs CHEAP EASY FAST To Run To Replicate To Share To Restore To Update To Backup To Duplicate To Setup To Destroy (Abstract Computers)
  • 51. Why Not Both? Easy Parallelization Platforms you otherwise can’t support Significantly lower staff & infrastructure costs • • •
  • 52. 3rd Party Services CHEAP EASY FAST Capacity Xtra Features (?) Maintenance Integration (?) Updating Team Work (?) Access To New Paralleling (?) CI (Abstract Solutions) (?) = Dependant on Provider?
  • 53. Selenium Grid + 3rd Party VMs = Parallel Heaven
  • 55. Appium (Abstract ...Devices?!) Native App Automation with Selenium Any Selenium Webdriver Tool No App modifications Totally Free and Open Source! (Mac client only ATM. Sorry >.>)
  • 56. How to Appium Download and Install Appium from http://www.appium.io Run Appium with your App Write your tests using the Selenium Webdriver JSON Subset: https://github.com/appium/appium/wiki/JSON- Wire-Protocol:-Supported-Methods Run your tests • • • •
  • 57. WAAAAA I Don’t Have a Mac! Contributes to the Appium Project Runs Appium in their Cloud Is working on Android support • • •
  • 59. Resources Play with Sauce Labs: 1000 Manual Minutes 200 Automated Minutes Promo Code: TestLearnPlay (exp 3/14) Our Blog: http://www.sauceio.com • • • • •
  • 60. Tools & Links Capybara: https://github.com/jnicklas/capybara Cucumber: http://cukes.info/ Appium: http://appium.io/ Supported methods: http://goo.gl/MiPcH Ruby examples: http://goo.gl/uQGh5 Sauce Labs Sign Up: http://goo.gl/uBTXX • • • • • •