SlideShare a Scribd company logo
PATTERNS OF A “GOOD”
TEST AUTOMATION
FRAMEWORK!
Anand Bagmar
Software Quality Evangelist
ABOUT ME
@BagmarAnand
Blog - essenceoftesting
about.me/anand.bagmar
WHAT DO YOU EXPECT FROM THIS SESSION?
TELL ME ...
¨ Any Managers in the room?
¨ Developers / Testers / Automation “folks” in the room?
¨ What toolset do you use for Automation?
¨ How many automated tests do you have?
¨ Have you heard the phrase - ”Test Automation code
should be of Production Quality”?
¨ Do you believe it?
¨ Anyone in the room does not code / understand code?
4
Disclaimer
Patterns of a “good” test automation framework
What is a Pattern?
Patterns of a “good” test automation framework
https://en.wikipedia.org/wiki/Software_design_pattern
Have you heard-of or
used any
Pattern(s) in Test
Automation?
COMMON PATTERNS USED IN TEST AUTOMATION
¨ Page-Object
¨ Business Layer
¨ Singleton
¨ Composition
¨ Factory
¨ Builder
Test Automation
Framework Patterns
Patterns of a “good” test automation framework
Code sample - #1
Page-Object Pattern
PAGE OBJECT PATTERN
Model pages
in code
Simulates user actions
One place change
Reduces code duplication
Snippets
of page
Patterns of a “good” test automation framework
Code sample - #2
AUTOMATION FRAMEWORK WITH PAGE OBJECTS
LIMITATIONS OF PAGE-OBJECT PATTERN
¨ Test intent gets polluted
¨ Duplication of Test intent & implementation
¨ Intent becomes Imperative
¨ Maintenance challenges
¨ Scaling challenges
Business-Layer
Page-Object Pattern
BUSINESS-LAYER PAGE-OBJECT PATTERN
Code sample - #3
ADVANTAGES OF
BUSINESS-LAYER PAGE-OBJECT PATTERN
¨ Validate what is important - Business requirements
¨ Test Pyramid remains sane
¨ Abstraction layers allow separation-of-concerns
¨ Changes are isolated
¨ Maintenance & Scaling becomes ‘easier’
Test Data Patterns
Why do we need to
think differently
about Test Data?
CRITERIA FOR TEST DATA
¨ Data is complex
¨ Needs to mimic “real” data
¨ Needs to be unique
¨ Data can be nested
¨ Though specified as static, may need to be Dynamic
¨ Data can be shared and reused
DIFFERENT WAYS TO SPECIFY TEST DATA
¨ In Test implementation
¨ In Test specification / intent
¨ In code … separate data structures / classes / etc.
¨ External files
TEST DATA SPECIFICATION EXAMPLES
¨ Excel
¨ CSV
¨ Property
¨ XML
¨ YAML
¨ Database
¨ Json
Code sample - #4
CRITERIA FOR SELECTION
¨ Easy to specify
¨ Easy to read and consume (by test framework)
¨ Ability to override specified data, easily
¨ Usable
TIPS FOR IMPLEMENTATION
¨ Consistent way to specify test data
¨ Read the data – as Business Entities
¨ Override as appropriate
¨ Create DSL to give meaning to data
¨ Use in test implementation
¨ Implement Test Data Entity Utilities – Build, Equals,
Copy, Find, etc.
Locators’ Patterns
DIFFERENT WAYS TO SPECIFY ELEMENT LOCATORS
¨ In Page-Objects
¨ In separate files, per Page-Object
¨ In external files / locator files
Advantages of
using Patterns for
Test Automation
ADVANTAGES OF PATTERNS
¨ Well known, well understood
¨ Tried & tested solutions for common problems
¨ Reduces complexity
¨ Language neutral
¨ Aid in communication
ADVANTAGES OF PATTERNS IN TEST AUTOMATION
Saves time & effort
(eventually)
Single ownership
Test Automation Code is of Production Quality!
Single point of change
Easy to –
- Implement
- Maintain
- Debug
- Scale
WHICH IS THE “BEST” PATTERN TO USE ?
It DEPENDS!
on the
Context!
REFERENCES
Page Objects – Google
https://code.google.com/p/selenium/wiki/PageObjects
Page Objects – Martin Fowler
http://martinfowler.com/bliki/PageObject.html
Perils of Page-Object Pattern – Anand Bagmar
http://essenceoftesting.blogspot.in/2014/09/perils-of-page-object-pattern.html
Test Design Consideration
http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp
Sample Test Framework implementation
https://github.com/anandbagmar/cuke-jvm-sample
@BagmarAnand
Blog - essenceoftesting
about.me/anand.bagmar
THANK YOU

More Related Content

PPTX
Automation test framework with cucumber – BDD
PPTX
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
PPTX
Introduction to Bdd and cucumber
PDF
Automation Best Practices
PDF
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
PPTX
BDD WITH CUCUMBER AND JAVA
PDF
Automated vs manual testing
PPTX
Setting up Page Object Model in Automation Framework
Automation test framework with cucumber – BDD
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Introduction to Bdd and cucumber
Automation Best Practices
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
BDD WITH CUCUMBER AND JAVA
Automated vs manual testing
Setting up Page Object Model in Automation Framework

What's hot (20)

PDF
Automation testing introduction for FujiNet
PPTX
Introduction to cypress in Angular (Chinese)
PDF
Test cases and bug report v3.2
PDF
Playwright: A New Test Automation Framework for the Modern Web
PDF
Selenium Maven With Eclipse | Edureka
PPT
Test Automation Framework Designs
PDF
Karate - powerful and simple framework for REST API automation testing
PPTX
BDD with SpecFlow and Selenium
PPTX
Presentation on Apache Jmeter
ODP
BDD with Cucumber
PDF
Introducing Playwright's New Test Runner
PDF
Page Object Model and Implementation in Selenium
PPTX
How to Design a Successful Test Automation Strategy
PDF
An Introduction to Test Driven Development
PPTX
Test Automation Framework with BDD and Cucumber
PPTX
Testing of React JS app
PDF
Test and Behaviour Driven Development (TDD/BDD)
PPTX
Cucumber presenation
PPT
Test Automation Best Practices (with SOA test approach)
Automation testing introduction for FujiNet
Introduction to cypress in Angular (Chinese)
Test cases and bug report v3.2
Playwright: A New Test Automation Framework for the Modern Web
Selenium Maven With Eclipse | Edureka
Test Automation Framework Designs
Karate - powerful and simple framework for REST API automation testing
BDD with SpecFlow and Selenium
Presentation on Apache Jmeter
BDD with Cucumber
Introducing Playwright's New Test Runner
Page Object Model and Implementation in Selenium
How to Design a Successful Test Automation Strategy
An Introduction to Test Driven Development
Test Automation Framework with BDD and Cucumber
Testing of React JS app
Test and Behaviour Driven Development (TDD/BDD)
Cucumber presenation
Test Automation Best Practices (with SOA test approach)
Ad

Viewers also liked (8)

PDF
The What, Why and How of Analytics Testing
PDF
Client-Side Performance Testing
PDF
Automating Web Analytics
PDF
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
PPT
Automation testing strategy, approach & planning
PDF
Test Automation Framework Design | www.idexcel.com
PPT
Test Automation Strategies For Agile
PDF
Agile Testing Framework - The Art of Automated Testing
The What, Why and How of Analytics Testing
Client-Side Performance Testing
Automating Web Analytics
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
Automation testing strategy, approach & planning
Test Automation Framework Design | www.idexcel.com
Test Automation Strategies For Agile
Agile Testing Framework - The Art of Automated Testing
Ad

Similar to Patterns of a “good” test automation framework (20)

PDF
Patterns of a "Good" Test Automation Framework, Locators & Data
PDF
Patterns in Test Automation
PDF
Patterns of Test Automation
PDF
Perils of Page-Object Pattern
PDF
Test Automation Design Patterns_ A Comprehensive Guide.pdf
PDF
Test Automation Design Patterns_ A Comprehensive Guide.pdf
PDF
6 Traits of a Successful Test Automation Architecture
PDF
Test automation design patterns
PPT
Test Automation Framework Development Introduction
PDF
Test Automation Patterns: Issues and Solutions
PPTX
Page objects: the good, the bad, the ugly
PPTX
Design patterns in test automation
PPT
Test Automation Framework Designs
PDF
Using The Page Object Pattern
PPTX
How to Become a Senior
PPTX
A New Model for Testing
PDF
What is Agile Testing? How does Automation help?
PDF
Test Automation Patterns
PPT
Test Automation Framework Online Training by QuontraSolutions
PDF
10 Lessons learned in test automation
Patterns of a "Good" Test Automation Framework, Locators & Data
Patterns in Test Automation
Patterns of Test Automation
Perils of Page-Object Pattern
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
6 Traits of a Successful Test Automation Architecture
Test automation design patterns
Test Automation Framework Development Introduction
Test Automation Patterns: Issues and Solutions
Page objects: the good, the bad, the ugly
Design patterns in test automation
Test Automation Framework Designs
Using The Page Object Pattern
How to Become a Senior
A New Model for Testing
What is Agile Testing? How does Automation help?
Test Automation Patterns
Test Automation Framework Online Training by QuontraSolutions
10 Lessons learned in test automation

More from Anand Bagmar (20)

PDF
The Path to Autonomous Testing - Anand Bagmar
PDF
My Journey With Appium @AppiumConf Sept 2024
PDF
Streamlining End-to-End Testing Automation
PDF
Eradicate Flaky Tests
PDF
Automating the real-user scenarios across multi-apps, and multi-devices
PDF
Visual Validation - The missing tip of the automation pyramid @GoT2022
PDF
Design Patterns in Automation
PDF
Change Tyres In A Moving Car - Make Functional Test Automation Effective Keynote
PDF
Rewrite vs Refactor (AgileIndia 2021)
PDF
Next Generation Functional & Visual Testing powered by AI
PDF
The Best Test Automation Framework is...
PDF
Eradicate Flaky Tests - AppiumConf 2021
PDF
Getting started with Appium 2.0
PDF
Visual Validation - The missing tip of the automation pyramid @AgileIndia2020
PDF
Selenium Deep Dive
PDF
Does your functional automation really add value?
PDF
Measuring Coverage From E2E Tests
PDF
Getting started with Visual Testing using Applitools - @TPC, Feb2020
PDF
Visual validation - The missing tip of the automation pyramid @ QA Symposium
PDF
Collaboration - A Taboo!
The Path to Autonomous Testing - Anand Bagmar
My Journey With Appium @AppiumConf Sept 2024
Streamlining End-to-End Testing Automation
Eradicate Flaky Tests
Automating the real-user scenarios across multi-apps, and multi-devices
Visual Validation - The missing tip of the automation pyramid @GoT2022
Design Patterns in Automation
Change Tyres In A Moving Car - Make Functional Test Automation Effective Keynote
Rewrite vs Refactor (AgileIndia 2021)
Next Generation Functional & Visual Testing powered by AI
The Best Test Automation Framework is...
Eradicate Flaky Tests - AppiumConf 2021
Getting started with Appium 2.0
Visual Validation - The missing tip of the automation pyramid @AgileIndia2020
Selenium Deep Dive
Does your functional automation really add value?
Measuring Coverage From E2E Tests
Getting started with Visual Testing using Applitools - @TPC, Feb2020
Visual validation - The missing tip of the automation pyramid @ QA Symposium
Collaboration - A Taboo!

Recently uploaded (20)

PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
ai tools demonstartion for schools and inter college
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Digital Strategies for Manufacturing Companies
PDF
AI in Product Development-omnex systems
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
medical staffing services at VALiNTRY
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
System and Network Administraation Chapter 3
PPTX
Online Work Permit System for Fast Permit Processing
PDF
System and Network Administration Chapter 2
PPTX
L1 - Introduction to python Backend.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
ai tools demonstartion for schools and inter college
Odoo Companies in India – Driving Business Transformation.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Digital Strategies for Manufacturing Companies
AI in Product Development-omnex systems
Navsoft: AI-Powered Business Solutions & Custom Software Development
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
medical staffing services at VALiNTRY
Softaken Excel to vCard Converter Software.pdf
System and Network Administraation Chapter 3
Online Work Permit System for Fast Permit Processing
System and Network Administration Chapter 2
L1 - Introduction to python Backend.pptx

Patterns of a “good” test automation framework