SlideShare a Scribd company logo
4 Stages of Test
Automation
Welcome to your first day at fake-amazon.com
Expectations
• We will move quickly, as there is a lot of content and 3
and a half hours will go much faster than we think it will

• The virtual machine thing was the best I could do without
having time to work with anyone ahead of time, as setting
up a working dev environment is non-trivial, if you
couldn’t get it going, pair up with someone who did

• If you have something in particular you are hoping to get
out of the class, put it up on the class backlog and I will
try and get to it.
Expectations
• You’ll get some time to try each stage on your own or in a
pair before we go over it as a class. Ideally you’d get a
couple hours to experiment with each stage, but we’re
running on a compressed timeframe.

• You won’t be an expert when you leave today, but you’ll
hopefully have a better idea of what the mistakes you’ll
make along the way look like so you can move past them
easier.
Agenda
• 8-8:15 - Working Agreements, Class Backlog

• 8:15-8:45 -Automation Crash Course (New Hire Training)

• 8:45 - 9:15 - Stage 1 - A basic Test

• 9:15 - 9:30 Class Walkthrough of Stage 1

• 9:30 - 10 Stage 2 - Cucumber

• 10-10:15 Class Walkthrough of Stage 2

• 10:15-10:45 Stage 3 - Gherkin as a Specification

• 10:45 - 11 Class Walkthrough of Stage 3

• 11-11:15 Class Walkthrough of Stage 4

• 11:15-11:30 - Questions and Answers
Four Stages of Automated Testing by Bradley Temple
How the Web Works
Four Stages of Automated Testing by Bradley Temple
Four Stages of Automated Testing by Bradley Temple
GET https://google.com
Content-Type text/html
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<html>
<body>
<div>
<p>
<strong>Hello</strong>, what’s up?
</p>
</div>
<div>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary">
>Google It</a>
</div>
</body>
</html>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary”>
>Google It</a>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary”>
>Google It</a>
<a href=“http://google.com”
id=“google-it”
class=“btn btn-primary”>
>Google It</a>
Open your Terminal Application
Under System Tools
And type these commands
cd ruby-crash-course
bin/start
DEMO: Messing around
with automation in the
console
So you’re the new hires? Great. Fantastic.
We’re trying to ship our new feature. Hold
onto your hats, we’re gonna ship everything
for FREE on orders worth more than $35.
We need some tests around it but manually
adding stuff to the cart is taking too long.
So you’re the new hires? Great. Fantastic.
I heard you know how to automate
websites, so if you can make that happen,
it’d be great.
So you’re the new hires? Great. Fantastic.
Stage 1 - Testing with
Scripts
git clone https://github.com/DVG/fake-amazon.git
Open your Terminal Application
Under System Tools
And type these commands
cd fake-amazon
bin/bootstrap
How to do it
• Your script is in the script directory.

• You can run it by executing bin/run-test

• If things stop working, run bin/bootstrap again

• I’ll be walking around, if you need help, ask
Things we should do in our
script
• Log In (student@example.com / supersecret)

• Add a cheap item to the cart

• Visit the checkout page

• Add an expensive item to the cart

• Navigate to the checkout page

• Complete checkout
Problems with this
approach
• Relies on ‘known data’

• Can’t be re-run (application state is changed as a result of
the test run)

• Doesn’t actually test anything

• Lots of repetition

• Tied to UI Details

• Not clear what the feature being tested is
So I went to a conference last week…
Hey that script you wrote is great, just
great. But everyone was talking about this
cucumber thing, have you heard of it?
So I went to a conference last week…
You can just write your tests in english and
you don’t need any of that code stuff, since
no one knows what that does anyway.
So I went to a conference last week…
How about we redo it with the Cucumber?
Stage 2 - Cucumber
So I was chatting with the devs…
Everyone loves what you’re doing with the
testing stuff
Except the devs, of course , they hate it.
So I was chatting with the devs…
They’re trying to use the specification for
the mobile app, but it super doesn’t work.
Can we make it just, like, general?
So I was chatting with the devs…
Stage 3 - Specification By
Example
Hey, that spec is great. We’re gonna use it
on the mobile app too.
So about those breaking tests
But tests are still breaking when some stuff
changes. The dev said you can do some
kinda object doohickey to fix it. Maybe pair
with them on it?
So about those breaking tests
Object Oriented Programming
(A hasty primer)
• Objects

• Receive Messages and produce Behavior

• click_link is a message that invokes the behavior of clicking an <a>
tag

• Is a model of a thing or idea in the real world

• Hide moving parts behind a particular interface (Encapsulation)

• Allow different objects to receive the same message but respond
differently (Polymorphism)

• Can gain behavior from a parent (Inheritance)
Object Oriented Programming
(A hasty primer)
• Classes

• Define a thing

• Person is a Class

• Instances

• A specific thing based on the definition (proper noun)

• Bradley is an instance of Person
Object Oriented Programming
(A hasty primer)
class Person
attr_reader :name,

:bmi,

:blood_pressure,

:pulse,

:last_slept_at,

:support_network,

:hunger_level,

:personal_sense_of_satisfaction,

:insecurities
def how_are_you_feeling?; end
end
Object Oriented Programming
(A hasty primer)
person = Person.new(“Bradley”, *other_attributes)

person.how_are_you_feeling?
# => “Fine”
Object Oriented Programming
(A hasty primer)
class Tester < Person
def how_are_you_feeling?
process_last_interaction_with_a_developer()
super()
end
end
Object Oriented Programming
(A hasty primer)
person = Tester.new(“Bradley”, *other_attributes)

person.how_are_you_feeling?
# => “Irritated”
Page Object
• Up till now we’ve been sending message directly to an
object controlling the browser, so all of our test code is
written in terms of low-level detail of browser interaction

• People do not think about whether something is a button
or a link, people think about tasks that they want to
complete on a page.

• A page object provides a way to hide away the details of
browser interaction behind a more intuitive task-based
message interface
Stage 4 - Page Objects
(class exercise)
Four Stages of Automated Testing by Bradley Temple

More Related Content

PPTX
From Gatekeeper to Partner by Kelsey Shannahan
PPTX
Test Strategy-The real silver bullet in testing by Matthew Eakin
PDF
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
PPT
'The Real Agile Testing Quadrants' with Michael Bolton
PDF
Test Driven Development (TDD) & Continuous Integration (CI)
PDF
A Taste of Exploratory Testing
PDF
Holistic testing in DevOps
PPTX
Injecting Threat Modeling into the SDLC by Susan Bradley
From Gatekeeper to Partner by Kelsey Shannahan
Test Strategy-The real silver bullet in testing by Matthew Eakin
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
'The Real Agile Testing Quadrants' with Michael Bolton
Test Driven Development (TDD) & Continuous Integration (CI)
A Taste of Exploratory Testing
Holistic testing in DevOps
Injecting Threat Modeling into the SDLC by Susan Bradley

What's hot (20)

PDF
The Test Coverage Outline: Your Testing Road Map
PDF
Growing a Company Test Community: Roles and Paths for Testers
PPTX
Will Robots Replace Testers?
PPT
Exploratory Testing Explained
PPTX
Exploratory testing workshop
PDF
Agile testing quadrants discussion
PPTX
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
PPTX
TDD That Was Easy!
PDF
Exploratory Testing in Practice
PPTX
What is this exploratory testing thing
PPTX
Agile testingandautomation
PDF
Using your testing mindset to explore requirements
PDF
03 - chomu prohramisty ne testuiut - yurii chulovskyi - it event 2013 (5)
PPTX
Claudiu Draghia ITEM 2018
PDF
Selenium Users Anonymous
PPTX
Test Estimation Hacks: Tips, Tricks and Tools Webinar
PPTX
There's no time to test, can you just automate it? by Anna Heiermann
PPTX
Exploratory Testing Explained and Experienced
PPTX
New Model Testing: A New Test Process and Tool
PPTX
Intro to TDD
The Test Coverage Outline: Your Testing Road Map
Growing a Company Test Community: Roles and Paths for Testers
Will Robots Replace Testers?
Exploratory Testing Explained
Exploratory testing workshop
Agile testing quadrants discussion
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
TDD That Was Easy!
Exploratory Testing in Practice
What is this exploratory testing thing
Agile testingandautomation
Using your testing mindset to explore requirements
03 - chomu prohramisty ne testuiut - yurii chulovskyi - it event 2013 (5)
Claudiu Draghia ITEM 2018
Selenium Users Anonymous
Test Estimation Hacks: Tips, Tricks and Tools Webinar
There's no time to test, can you just automate it? by Anna Heiermann
Exploratory Testing Explained and Experienced
New Model Testing: A New Test Process and Tool
Intro to TDD
Ad

Similar to Four Stages of Automated Testing by Bradley Temple (20)

PPT
WE-06-Testing.ppt
DOCX
CH 1018. Schools often use concrete rewards to increase adaptive.docx
PPTX
Testing ASP.NET - Progressive.NET
PDF
2019-12-WWC-Toronto.pdf
PDF
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
PDF
ATDD BY Example With Cucumber
PDF
Automation Abstractions: Page Objects and Beyond
PPTX
WINSEM2021-22_ITE2004_ETH_VL2021220500452_Reference_Material_I_26-04-2022_tes...
PPTX
Test execution
PPT
The technology of the Human Protein Reference Database (draft, 2003)
PPTX
Intro to agile testing
PDF
Acceptance Testing of Web UI
PPT
Beginners QA Testing
PDF
Acceptance- and Behavior-Driven Development with Cucumber: Three Case Studies
PDF
Having Fun Building Web Applications (Day 1 Slides)
PPT
Agile Testing
PDF
Why BDD is our BFF
PPTX
Automated integration tests for ajax applications (с. карпушин, auriga)
PPT
PDF
Confessions of an Accidental Security Tester
WE-06-Testing.ppt
CH 1018. Schools often use concrete rewards to increase adaptive.docx
Testing ASP.NET - Progressive.NET
2019-12-WWC-Toronto.pdf
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
ATDD BY Example With Cucumber
Automation Abstractions: Page Objects and Beyond
WINSEM2021-22_ITE2004_ETH_VL2021220500452_Reference_Material_I_26-04-2022_tes...
Test execution
The technology of the Human Protein Reference Database (draft, 2003)
Intro to agile testing
Acceptance Testing of Web UI
Beginners QA Testing
Acceptance- and Behavior-Driven Development with Cucumber: Three Case Studies
Having Fun Building Web Applications (Day 1 Slides)
Agile Testing
Why BDD is our BFF
Automated integration tests for ajax applications (с. карпушин, auriga)
Confessions of an Accidental Security Tester
Ad

More from QA or the Highway (20)

PDF
KrishnaToolComparisionPPT.pdf
PPTX
Ravi Lakkavalli - World Quality Report.pptx
PPTX
Caleb Crandall - Testing Between the Buckets.pptx
PDF
Thomas Haver - Mobile Testing.pdf
PDF
Thomas Haver - Example Mapping.pdf
PDF
Joe Colantonio - Actionable Automation Awesomeness in Testing Farm.pdf
PDF
Sarah Geisinger - Continious Testing Metrics That Matter.pdf
PDF
Jeff Sing - Quarterly Service Delivery Reviews.pdf
PDF
Leandro Melendez - Chihuahua Load Tests.pdf
PDF
Rick Clymer - Incident Management.pdf
PPTX
Robert Fornal - ChatGPT as a Testing Tool.pptx
PDF
Federico Toledo - Extra-functional testing.pdf
PPTX
Andrew Knight - Managing the Test Data Nightmare.pptx
PDF
Melissa Tondi - Automation We_re Doing it Wrong.pdf
PDF
Jeff Van Fleet and John Townsend - Transition from Testing to Leadership.pdf
PPTX
DesiradhaRam Gadde - Testers _ Testing in ChatGPT-AI world.pptx
PDF
Damian Synadinos - Word Smatter.pdf
PDF
Lee Barnes - What Successful Test Automation is.pdf
PPTX
Jordan Powell - API Testing with Cypress.pptx
PPTX
Carlos Kidman - Exploring AI Applications in Testing.pptx
KrishnaToolComparisionPPT.pdf
Ravi Lakkavalli - World Quality Report.pptx
Caleb Crandall - Testing Between the Buckets.pptx
Thomas Haver - Mobile Testing.pdf
Thomas Haver - Example Mapping.pdf
Joe Colantonio - Actionable Automation Awesomeness in Testing Farm.pdf
Sarah Geisinger - Continious Testing Metrics That Matter.pdf
Jeff Sing - Quarterly Service Delivery Reviews.pdf
Leandro Melendez - Chihuahua Load Tests.pdf
Rick Clymer - Incident Management.pdf
Robert Fornal - ChatGPT as a Testing Tool.pptx
Federico Toledo - Extra-functional testing.pdf
Andrew Knight - Managing the Test Data Nightmare.pptx
Melissa Tondi - Automation We_re Doing it Wrong.pdf
Jeff Van Fleet and John Townsend - Transition from Testing to Leadership.pdf
DesiradhaRam Gadde - Testers _ Testing in ChatGPT-AI world.pptx
Damian Synadinos - Word Smatter.pdf
Lee Barnes - What Successful Test Automation is.pdf
Jordan Powell - API Testing with Cypress.pptx
Carlos Kidman - Exploring AI Applications in Testing.pptx

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
KodekX | Application Modernization Development
DOCX
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx

Four Stages of Automated Testing by Bradley Temple

  • 1. 4 Stages of Test Automation Welcome to your first day at fake-amazon.com
  • 2. Expectations • We will move quickly, as there is a lot of content and 3 and a half hours will go much faster than we think it will • The virtual machine thing was the best I could do without having time to work with anyone ahead of time, as setting up a working dev environment is non-trivial, if you couldn’t get it going, pair up with someone who did • If you have something in particular you are hoping to get out of the class, put it up on the class backlog and I will try and get to it.
  • 3. Expectations • You’ll get some time to try each stage on your own or in a pair before we go over it as a class. Ideally you’d get a couple hours to experiment with each stage, but we’re running on a compressed timeframe. • You won’t be an expert when you leave today, but you’ll hopefully have a better idea of what the mistakes you’ll make along the way look like so you can move past them easier.
  • 4. Agenda • 8-8:15 - Working Agreements, Class Backlog • 8:15-8:45 -Automation Crash Course (New Hire Training) • 8:45 - 9:15 - Stage 1 - A basic Test • 9:15 - 9:30 Class Walkthrough of Stage 1 • 9:30 - 10 Stage 2 - Cucumber • 10-10:15 Class Walkthrough of Stage 2 • 10:15-10:45 Stage 3 - Gherkin as a Specification • 10:45 - 11 Class Walkthrough of Stage 3 • 11-11:15 Class Walkthrough of Stage 4 • 11:15-11:30 - Questions and Answers
  • 6. How the Web Works
  • 11. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 12. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 13. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 14. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 15. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 16. <html> <body> <div> <p> <strong>Hello</strong>, what’s up? </p> </div> <div> <a href=“http://google.com” id=“google-it” class=“btn btn-primary"> >Google It</a> </div> </body> </html>
  • 20. Open your Terminal Application Under System Tools And type these commands cd ruby-crash-course bin/start
  • 21. DEMO: Messing around with automation in the console
  • 22. So you’re the new hires? Great. Fantastic. We’re trying to ship our new feature. Hold onto your hats, we’re gonna ship everything for FREE on orders worth more than $35.
  • 23. We need some tests around it but manually adding stuff to the cart is taking too long. So you’re the new hires? Great. Fantastic.
  • 24. I heard you know how to automate websites, so if you can make that happen, it’d be great. So you’re the new hires? Great. Fantastic.
  • 25. Stage 1 - Testing with Scripts
  • 26. git clone https://github.com/DVG/fake-amazon.git Open your Terminal Application Under System Tools And type these commands cd fake-amazon bin/bootstrap
  • 27. How to do it • Your script is in the script directory. • You can run it by executing bin/run-test • If things stop working, run bin/bootstrap again • I’ll be walking around, if you need help, ask
  • 28. Things we should do in our script • Log In (student@example.com / supersecret) • Add a cheap item to the cart • Visit the checkout page • Add an expensive item to the cart • Navigate to the checkout page • Complete checkout
  • 29. Problems with this approach • Relies on ‘known data’ • Can’t be re-run (application state is changed as a result of the test run) • Doesn’t actually test anything • Lots of repetition • Tied to UI Details • Not clear what the feature being tested is
  • 30. So I went to a conference last week… Hey that script you wrote is great, just great. But everyone was talking about this cucumber thing, have you heard of it?
  • 31. So I went to a conference last week… You can just write your tests in english and you don’t need any of that code stuff, since no one knows what that does anyway.
  • 32. So I went to a conference last week… How about we redo it with the Cucumber?
  • 33. Stage 2 - Cucumber
  • 34. So I was chatting with the devs… Everyone loves what you’re doing with the testing stuff
  • 35. Except the devs, of course , they hate it. So I was chatting with the devs…
  • 36. They’re trying to use the specification for the mobile app, but it super doesn’t work. Can we make it just, like, general? So I was chatting with the devs…
  • 37. Stage 3 - Specification By Example
  • 38. Hey, that spec is great. We’re gonna use it on the mobile app too. So about those breaking tests
  • 39. But tests are still breaking when some stuff changes. The dev said you can do some kinda object doohickey to fix it. Maybe pair with them on it? So about those breaking tests
  • 40. Object Oriented Programming (A hasty primer) • Objects • Receive Messages and produce Behavior • click_link is a message that invokes the behavior of clicking an <a> tag • Is a model of a thing or idea in the real world • Hide moving parts behind a particular interface (Encapsulation) • Allow different objects to receive the same message but respond differently (Polymorphism) • Can gain behavior from a parent (Inheritance)
  • 41. Object Oriented Programming (A hasty primer) • Classes • Define a thing • Person is a Class • Instances • A specific thing based on the definition (proper noun) • Bradley is an instance of Person
  • 42. Object Oriented Programming (A hasty primer) class Person attr_reader :name,
 :bmi,
 :blood_pressure,
 :pulse,
 :last_slept_at,
 :support_network,
 :hunger_level,
 :personal_sense_of_satisfaction,
 :insecurities def how_are_you_feeling?; end end
  • 43. Object Oriented Programming (A hasty primer) person = Person.new(“Bradley”, *other_attributes)
 person.how_are_you_feeling? # => “Fine”
  • 44. Object Oriented Programming (A hasty primer) class Tester < Person def how_are_you_feeling? process_last_interaction_with_a_developer() super() end end
  • 45. Object Oriented Programming (A hasty primer) person = Tester.new(“Bradley”, *other_attributes)
 person.how_are_you_feeling? # => “Irritated”
  • 46. Page Object • Up till now we’ve been sending message directly to an object controlling the browser, so all of our test code is written in terms of low-level detail of browser interaction • People do not think about whether something is a button or a link, people think about tasks that they want to complete on a page. • A page object provides a way to hide away the details of browser interaction behind a more intuitive task-based message interface
  • 47. Stage 4 - Page Objects (class exercise)