SlideShare a Scribd company logo
FUNCTIONAL BROWSER
AUTOMATION TESTING
FOR NEWBS
Bryan Arendt
@ctrlshiftbryan
Canopy F#
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
HISTORY OF BRYAN ARENDT
Commodore 64 + Basic (1989)
Guitar (1995)
OSU (1999)
The Sun (2002)
Quit Day Job (2005)
First Heard of F# (2013)
Code Mash (2016)
THIS TALK
Intro Story
Problem
Why Functional Programming
Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
THE PROBLEM(S)
How do we learn how to be a more
functional programmer(s)?
How do we reduce complexity of
automated browser testing?
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
WHY FUNCTIONAL?
Readability and maintainability
 A function accomplishes a specific task given its arguments. The function does not
rely on any external state
Easier testing and debugging
 They can be tested in isolation
Reduce Code = Reduce Bugs
Easier reiterative development
 the code is easier to refactor, changes to design are often easier to implement
THINKING FUNCTIONALLY
Take parameters Transforms values Returns new values
FUNCTIONAL PROGRAMMING
CONCEPTS
Immutability Expressiveness
Types & Values Pure Functions
FUNCTIONAL PROGRAMMING
CONCEPTS
Immutability Expressiveness
Types & Values Pure Functions
IMMUTABILITY
Values and State cannot be changed once created
Removes side effects
Removes changing state
VALUES INSTEAD OF VARIABLES
Instead of changing the value of an existing variable, create a new
variable with the specified initial value.
In functional programming we bind a value to a name.
Functional Browser Automation Testing for Newbs
Functional Browser Automation Testing for Newbs
FUNCTIONAL PROGRAMMING
CONCEPTS
Immutability Expressiveness
Types & Values Pure Functions
EXAMPLE OF EXPRESSIVENESS
We are going to explore the idea of being terse or expressive.
I’m going to have some help from two people…
“There are only two hard things in Computer Science: cache
invalidation and naming things.”
Phil Karlton
Function f
Var x
UNCLE BOB
NAMES
Variable Names
Variables with large scope should be long, and small scope should be
short. Variables scope should be proportional with their length of
names. Variable names like I and j are just fine if their scope is five
lines long.
Function Names
The longer the scope of a function, the shorter its name should be.
Functions that are called locally from a few nearby places should have
long descriptive names, and the longest function names should be
given to those functions that are called from just one place.
Functional Browser Automation Testing for Newbs
IN FUNCTIONAL PROGRAMMING
Functions are commonly named f
Variables are commonly named x
FUNCTIONAL PROGRAMMING
CONCEPTS
Immutability Expressiveness
Types & Values Pure Functions
TYPES & VALUES
Every function is a value
Every value has a type
Entire programs can be type checked for correctness
PASSING A FUNCTION TO A
FUNCTION
FUNCTIONAL PROGRAMMING
CONCEPTS
Immutability Expressiveness
Types & Values Pure Functions
PURE FUNCTIONS: REMOVING SIDE
EFFECTS
Kris Jenkins – What is Functional Programming?
http://blog.jenkster.com/2015/12/what-is-functional-
programming.html
Two types of inputs and outputs
NORMAL
HIDDEN
“SIDE-EFFECTS ARE THE
COMPLEXITY ICEBERG”
“SIDE-EFFECTS ARE THE
COMPLEXITY ICEBERG”
FUNCTION W/ HIDDEN INPUT
PURE FUNCTION
REVIEW FUNCTIONAL
PROGRAMMING CONCEPTS
Immutability Expressiveness
Types Pure Functions
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
WHY FUNCTIONAL – STORY 1
Rachel Reese
http://rachelree.se/rewriting-from-c-into-f/
I rewrote into F# a super simple data transferring app from C#
C# -> F#
70% less time! - F# 2 minutes
25% less code! – 140 lines to 103
Bug - processing tremendously more data than needed (F# made this
apparent)
Bug Couple Hours -> 7 Minutes – fixing C#
WHY FUNCTIONAL – STORY 2
Does the Language You Use Make a Difference (revisited)?
http://simontylercousins.net/does-the-language-you-use-make-a-
difference-revisited/
Simon Tyler Cousins @simontcousins
WHY FUNCTIONAL – STORY 2
Develop an application to evaluate the revenue due from Balancing
Services contracts
Existing solution implemented in C#
PROBLEMS
not all of the contracts had been implemented – too complex
hard to maintain the large code base
impossible to test without live data
low confidence in the numbers it produced
failed to evaluate the contracts in near-real-time
DESIGN PRINCIPLE
Stay safe, Stay functional.
In particular, we have an immutable domain model and persistence
store. Pure functions are used to work with this domain model.
Functional Browser Automation Testing for Newbs
Functional Browser Automation Testing for Newbs
Functional Browser Automation Testing for Newbs
Simon Tyler Cousins @simontcousins
HOW CAN WE ALL DO THIS?
How can we convince this guy?
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
Functional Browser Automation Testing for Newbs
F#
Mostly Functional
Leverage .Net Environment
We can call a compiled C# .Net program or library from F# very easily
Nuget!
C# MOST POPULAR FEATURES
Generics / Type parameterization
Lambda Expressions
Delegates
Type Inference (limited)
F#
Functional Imperative
Haskel,
OCaml
F# C# C
Multi-paradigmFunctional Imperative
MIXED PARADIGM LANGUAGES
If C# is a object oriented language that supports and includes some
functional concepts
F# in the inverse.
Then F# is a functional language that supports object oriented
concepts
LOOKING FOR AN EXCUSE TO USE
F#
CANOPY - F#RICTIONLESS WEB TESTING
one goal in mind, make UI testing simple:
• Solid stabilization layer built on top of
Selenium.
• Quick to learn. Even if you've never done UI
Automation, and don't know F#.
• Clean, concise API.
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
WHY AUTOMATED TESTING?
Regression
Test More Like A User (High Level)
Combinatorial Testing
Exact Requirements
Many Browsers
WHAT IS SELENIUM?
A Unified API for Browsers
WebDriver
Server/Grid
IDE (For Recording)
SELENIUM ARCHITECTURE
Library- [C#][Ruby][Java][Python][...]
 Navigate to a Page
 Send Keystroke
 Click on Elements
 Read Information
WebDriver API Rest Based Web Service
WebDriver Executable
 translates API calls
 each browser has its own web driver
 Chrome and IE each have separate executables
 Firefox and PhantomJS are built-in
THIS TALK
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
CANOPY F#
Canopy F# .Net C# Nuget
WebDriver
REST Api
WebDriver
Executable
CANOPY
Actions
Assertions
Testing
Configuration
Reporting
Functional Browser Automation Testing for Newbs
OPEN LIBRARIES AND START A
BROWSER
DEFINE A TEST
THE &&& FUNCTION
INFIX FUNCTION
Prefix notation: + 3 4
Infix notation: 3 + 4
Functional Browser Automation Testing for Newbs
NO BRACES
ASSERTION FUNCTIONS
Functional Browser Automation Testing for Newbs
Functional Browser Automation Testing for Newbs
PATTERN MATCHING
Common.fs
Login.fs
Functional Browser Automation Testing for Newbs
THIS TALK RECAP
Intro Story
Problem
Why Functional Programming & Functional Concepts
Why Functional Stories
F#
Selenium & Why Automated Testing
Canopy
LEARN MORE
LEARN MORE
http://fsharpforfunandprofit.com/
http://fsharpforfunandprofit.com/series/low-risk-ways-to-use-
fsharp-at-work.html
FUNCTIONAL PROGRAMMING @
CODEMASH
Programs that Write Programs: How Compilers Work
 Thursday 4:45 PM Indigo Bay
Functional Programming Basics in ES6
 Thursday 4:45 PM Zambezi
A Developer’s Journey from Object Oriented to Functional
Programming
 Friday 11:00 AM Zambezi
Erlang, or How I Learned to Stop Worrying and Let Things Fail
 Friday 2:45 PM Orange

More Related Content

Similar to Functional Browser Automation Testing for Newbs (20)

PDF
Introduction to functional programming
Konrad Szydlo
 
PPTX
Succeeding with Functional-first Programming in Enterprise
dsyme
 
PPTX
When life gives you functions make functional programs!
Aaron Levin
 
PPTX
Functional Programming with F#: Getting Started & Basic Concepts
Alex Casquete
 
PPTX
Why functional programming in C# & F#
Riccardo Terrell
 
PPTX
Introduction to Functional Programming
Dave Fancher
 
PDF
379008-rc217-functionalprogramming
Luis Atencio
 
PPTX
Automate your functional testing
Yasui Tsutomu
 
PPTX
Intro f# functional_programming
Mauro Ghiani
 
PPTX
Break Free with Managed Functional Programming: An Introduction to F#
Dave Fancher
 
PPTX
Break Free with Managed Functional Programming: An Introduction to F#
IndyMobileNetDev
 
PPTX
Functional Programming
Ryan Riley
 
PPTX
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Skills Matter
 
PPTX
Domain Modeling & Full-Stack Web Development F#
Kevin Avignon
 
PDF
Functional Programming in C#: How to write better C# code 1st Edition Enrico ...
tomaimaschjt
 
PPTX
TechDaysNL 2015 - F# for C# Developers
Ronald Harmsen
 
PDF
Becoming Functional Steps For Transforming Into A Functional Programmer Joshu...
chelliidzia
 
PPTX
Functional programming
PiumiPerera7
 
PPTX
How Functional Programming Made Me A Better Developer
Cameron Presley
 
PDF
45 F#antastic minutes!
Alex Casquete
 
Introduction to functional programming
Konrad Szydlo
 
Succeeding with Functional-first Programming in Enterprise
dsyme
 
When life gives you functions make functional programs!
Aaron Levin
 
Functional Programming with F#: Getting Started & Basic Concepts
Alex Casquete
 
Why functional programming in C# & F#
Riccardo Terrell
 
Introduction to Functional Programming
Dave Fancher
 
379008-rc217-functionalprogramming
Luis Atencio
 
Automate your functional testing
Yasui Tsutomu
 
Intro f# functional_programming
Mauro Ghiani
 
Break Free with Managed Functional Programming: An Introduction to F#
Dave Fancher
 
Break Free with Managed Functional Programming: An Introduction to F#
IndyMobileNetDev
 
Functional Programming
Ryan Riley
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Skills Matter
 
Domain Modeling & Full-Stack Web Development F#
Kevin Avignon
 
Functional Programming in C#: How to write better C# code 1st Edition Enrico ...
tomaimaschjt
 
TechDaysNL 2015 - F# for C# Developers
Ronald Harmsen
 
Becoming Functional Steps For Transforming Into A Functional Programmer Joshu...
chelliidzia
 
Functional programming
PiumiPerera7
 
How Functional Programming Made Me A Better Developer
Cameron Presley
 
45 F#antastic minutes!
Alex Casquete
 

Recently uploaded (20)

PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
Ad

Functional Browser Automation Testing for Newbs

Editor's Notes

  • #5: Ever since I was 10 I knew I wanted to be a software developer. Probobably not too different from a lot of people in this. Room. In addition to loving programming I had a hobby of playing guitar in bands. Moved to OSU music introduced me to people. Programming did not. Played in different bands and made musician friends. Joined a band with some friends of previous bands, moved to LA and got signed by Warner Brothers. Still did some programming in things like flash.
  • #20: Is this good naming? The conventional thought is No. http://blog.ploeh.dk/2015/08/17/when-x-y-and-z-are-great-variable-names/
  • #21: Some of you have Some haven’t
  • #23: Remove noise. This is a much more expressive way of conveying the same information. So when you here that F# is expressive think of this. Don’t we want to do the same things with our programming?
  • #27: Show module 3
  • #48: Bill Lumbergh
  • #55: Bill Lumbergh
  • #56: Canopy is our excuse
  • #64: This is canopy’s “Hello World”