SlideShare une entreprise Scribd logo
1  sur  20
© Sauce Labs, Inc.
Three Approaches to Optimizing Your Selenium
Test Designs
Presented by QualiTest and Sauce Labs, Inc.11/4/2015
© Sauce Labs, Inc.
Brian Van Stone – Solutions
Architect, QualiTest
Neil Manvar – Solutions
Architect, Sauce Labs
© Sauce Labs, Inc.© Sauce Labs, Inc.
Agenda
Good design approaches with Selenium
Different types of test designs
• Page Object Model
• Behavior Driven Development
• Keyword Driven Design
Pros and cons of design methodologies
Q&A
© Sauce Labs, Inc.
The Importance of Design
• Key Success Factors in Test
Automation
• Strong Design
• Consistency
• Reliability
• Benefits
• Faster development
• More accurate results
• Reduced cost of maintenance
• Ability to address absent
features of Selenium
© Sauce Labs, Inc.
Page Object Design Pattern
• Definition: Model the UI components of your application as Page Objects which:
• Expose the services of a page to the test developer
• Abstract the deep knowledge of page structure away from the test
• Disadvantages:
• Cost of framework development
• Not ideal for all applications
• Some pages can be highly interactive
and serve a very large amount of
content
• Requires a high degree of technical
proficiency from the testing team
• Advantages:
• High tolerance of changes in the UI
• Intuitive model for automating workflow driven
functionality
• Parallelism with other design patterns like
MVC
• Reduction in code duplication
• Coupling of object recognition and app
functionality
© Sauce Labs, Inc.
Why Page Object?
• Reasons to consider page object
design:
• Large amounts of workflow driven
content that lends itself to page-by-
page automation
• Leveraging synergy with a
development team employing the
MVC design pattern
• Separation of implementation from
presentation reduces maintenance
costs
• Reasons to explore other options:
• Large amounts of highly interactive
single-page content. This is
becoming less common than it once
was.
• Requirement or desire to involve
non-technical SMEs in the test
design and execution processes
© Sauce Labs, Inc.
Page Object Sample and Further Discussion
© Sauce Labs, Inc.
BDD
• BDD = Behavior Driver Development
• maintainable, readable, easy to debug
• Test Automation Framework
• Cucumber
• Selenium-Webdriver
• Page-Object
• Selenium-Webdriver
© Sauce Labs, Inc.
Testing using BDD Tools - Pro / Cons
• Pros
• Requirements and Behavior are clear
• Can be read / understood by all
• Easier to debug and maintain
• Test case is from a “user” perspective
• Cons
• Another layer / technology that is introduced into
tech stack
• Onboarding – how to write proper step definitions,
features, scenario outlines, regex’s, etc.
© Sauce Labs, Inc.
Keyword Driven Testing (KDT)
• Definition: Represent functionality to be tested as keywords which are executed in
combination to model test behavior
• Disadvantages:
• Risk of dependency creation between
keywords must be mitigated by design
• Sometimes such dependencies are
unavoidable
• Maintenance costs are generally
managed more by design than by
technical savvy.
• Addresses only application functionality
rather than application objects
• Requires additional design of an object
recognition strategy
• Advantages:
• Strong and clear separation of design,
data, and development
• Capacity to understand test automation
flow without much or any technical
knowledge
• Extreme abstraction of automation
implementation
© Sauce Labs, Inc.
Why KDT?
• Reasons to consider KDT:
• Culture and support structure tending
towards business driven test design
• Separation of design, data, and
development
• Organizational structure will sometimes
lend these three categories to different
existing roles in the organization
• Requirement to have non-programming
personnel interact with test automation
(design, execution, or analysis)
• Very easy to data-drive tests
• Reasons to explore other options:
• Large amounts of dependent functionality
• You can model workflows in KDT but
complex workflows can present issues
• Desire to keep test automation technical
and reduce design overhead
© Sauce Labs, Inc.
KDT Sample and Further Discussion
• Start with a generic keyword
• Create a concept for an execution flow
• Make sure keyword execution can handle
exception cases
• Devise a strategy for sharing data
between keywords and/or tests
© Sauce Labs, Inc.
KDT Sample and Further Discussion
• Create the core of the framework that
enables execution of tests
• Create a primary driver class which can
parse your input (driven by spreadsheet,
xml files, JSON, etc.)
• Control execution flow at the highest level
here. Have a hierarchy of classes to
support each level (Test Cases,
Keywords, etc.)
• The most light weight means of execution
will be driving it through a main method
and simply invoking it from the command
line
• Reflection is your friend
© Sauce Labs, Inc.
KDT Sample and Further Discussion
• With the core framework in place,
build useful and reusable keywords
• This is a prototype for a keyword
that manages connections
• Create an abstract class which
manages connection creation/reuse
during initialization
• And manages connection
cleanup/rollback during cleanup
© Sauce Labs, Inc.
KDT Sample and Further Discussion
• Create simple keywords leveraging
abstract functionality
• Keywords that perform a specific task
should perform ONLY that task whenever
possible
• A specific keyword implementation should
only care about the arguments unique to it
• Reduce maintenance costs by eliminating
boiler plate or common code
© Sauce Labs, Inc.
Summary
• Key Takeaways
• Design, design, design
• Focus on reducing maintenance costs
• Choose the best fit
© Sauce Labs, Inc.
Questions?
© Sauce Labs, Inc.
More Info on Sauce Labs
Resources
• WhitePaper: How to get the most out of your CI / CD work flow with automated
testing
http://tinyurl.com/p5umo6p
• Sauce Labs Docs – tutorials for writing scripts
https://docs.saucelabs.com/
• Sign up for a free trial of Sauce
https://saucelabs.com/signup/trial
© Sauce Labs, Inc.
More Info QualiTest
Resources
• Check us out!
http://www.qualitestgroup.com
• See some stories of what we have done with Selenium!
http://www.qualitestgroup.com/software-testing/testing-services-through-selenium/
© Sauce Labs, Inc.
Thank you!

Contenu connexe

En vedette

Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016Michael Hughes
 
Continuous delivery mobile application development
Continuous delivery mobile application developmentContinuous delivery mobile application development
Continuous delivery mobile application developmentThoughtworks
 
Advanced Visual Test Automation With Selenium
Advanced Visual Test Automation With SeleniumAdvanced Visual Test Automation With Selenium
Advanced Visual Test Automation With Seleniumadamcarmi
 
Ensuring Successful OPNFV-based NFV Deployments | QualiTest Group
Ensuring Successful OPNFV-based NFV Deployments | QualiTest GroupEnsuring Successful OPNFV-based NFV Deployments | QualiTest Group
Ensuring Successful OPNFV-based NFV Deployments | QualiTest GroupQualitest
 
Testing - the gatekeeper for quality in NFV
Testing - the gatekeeper for quality in NFVTesting - the gatekeeper for quality in NFV
Testing - the gatekeeper for quality in NFVQualitest
 
Webinar how to ensure sdn-nfv doesn't break your network
Webinar   how to ensure sdn-nfv doesn't break your networkWebinar   how to ensure sdn-nfv doesn't break your network
Webinar how to ensure sdn-nfv doesn't break your networkQualitest
 
NFV Testing & DevOps | QualiTest
NFV Testing & DevOps | QualiTestNFV Testing & DevOps | QualiTest
NFV Testing & DevOps | QualiTestQualitest
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and AlgorithmsDeiptii Das
 
How To Find Information On Your Own
How To Find Information On Your OwnHow To Find Information On Your Own
How To Find Information On Your OwnDave Haeffner
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and SeleniumNikolay Vasilev
 
Simplistic, delicate beauty
Simplistic, delicate beautySimplistic, delicate beauty
Simplistic, delicate beautyMakala (D)
 
The Next Generation of AI and Deep Learning - GTC17
The Next Generation of AI and Deep Learning - GTC17The Next Generation of AI and Deep Learning - GTC17
The Next Generation of AI and Deep Learning - GTC17NVIDIA
 

En vedette (14)

Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016
 
Continuous delivery mobile application development
Continuous delivery mobile application developmentContinuous delivery mobile application development
Continuous delivery mobile application development
 
Advanced Visual Test Automation With Selenium
Advanced Visual Test Automation With SeleniumAdvanced Visual Test Automation With Selenium
Advanced Visual Test Automation With Selenium
 
Ensuring Successful OPNFV-based NFV Deployments | QualiTest Group
Ensuring Successful OPNFV-based NFV Deployments | QualiTest GroupEnsuring Successful OPNFV-based NFV Deployments | QualiTest Group
Ensuring Successful OPNFV-based NFV Deployments | QualiTest Group
 
Testing - the gatekeeper for quality in NFV
Testing - the gatekeeper for quality in NFVTesting - the gatekeeper for quality in NFV
Testing - the gatekeeper for quality in NFV
 
Webinar how to ensure sdn-nfv doesn't break your network
Webinar   how to ensure sdn-nfv doesn't break your networkWebinar   how to ensure sdn-nfv doesn't break your network
Webinar how to ensure sdn-nfv doesn't break your network
 
NFV Testing & DevOps | QualiTest
NFV Testing & DevOps | QualiTestNFV Testing & DevOps | QualiTest
NFV Testing & DevOps | QualiTest
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and Algorithms
 
How To Find Information On Your Own
How To Find Information On Your OwnHow To Find Information On Your Own
How To Find Information On Your Own
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and Selenium
 
Simplistic, delicate beauty
Simplistic, delicate beautySimplistic, delicate beauty
Simplistic, delicate beauty
 
The Next Generation of AI and Deep Learning - GTC17
The Next Generation of AI and Deep Learning - GTC17The Next Generation of AI and Deep Learning - GTC17
The Next Generation of AI and Deep Learning - GTC17
 

Plus de 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
 

Plus de 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
 

Dernier

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Dernier (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

Three approaches to optimizing your selenium test designs

  • 1. © Sauce Labs, Inc. Three Approaches to Optimizing Your Selenium Test Designs Presented by QualiTest and Sauce Labs, Inc.11/4/2015
  • 2. © Sauce Labs, Inc. Brian Van Stone – Solutions Architect, QualiTest Neil Manvar – Solutions Architect, Sauce Labs
  • 3. © Sauce Labs, Inc.© Sauce Labs, Inc. Agenda Good design approaches with Selenium Different types of test designs • Page Object Model • Behavior Driven Development • Keyword Driven Design Pros and cons of design methodologies Q&A
  • 4. © Sauce Labs, Inc. The Importance of Design • Key Success Factors in Test Automation • Strong Design • Consistency • Reliability • Benefits • Faster development • More accurate results • Reduced cost of maintenance • Ability to address absent features of Selenium
  • 5. © Sauce Labs, Inc. Page Object Design Pattern • Definition: Model the UI components of your application as Page Objects which: • Expose the services of a page to the test developer • Abstract the deep knowledge of page structure away from the test • Disadvantages: • Cost of framework development • Not ideal for all applications • Some pages can be highly interactive and serve a very large amount of content • Requires a high degree of technical proficiency from the testing team • Advantages: • High tolerance of changes in the UI • Intuitive model for automating workflow driven functionality • Parallelism with other design patterns like MVC • Reduction in code duplication • Coupling of object recognition and app functionality
  • 6. © Sauce Labs, Inc. Why Page Object? • Reasons to consider page object design: • Large amounts of workflow driven content that lends itself to page-by- page automation • Leveraging synergy with a development team employing the MVC design pattern • Separation of implementation from presentation reduces maintenance costs • Reasons to explore other options: • Large amounts of highly interactive single-page content. This is becoming less common than it once was. • Requirement or desire to involve non-technical SMEs in the test design and execution processes
  • 7. © Sauce Labs, Inc. Page Object Sample and Further Discussion
  • 8. © Sauce Labs, Inc. BDD • BDD = Behavior Driver Development • maintainable, readable, easy to debug • Test Automation Framework • Cucumber • Selenium-Webdriver • Page-Object • Selenium-Webdriver
  • 9. © Sauce Labs, Inc. Testing using BDD Tools - Pro / Cons • Pros • Requirements and Behavior are clear • Can be read / understood by all • Easier to debug and maintain • Test case is from a “user” perspective • Cons • Another layer / technology that is introduced into tech stack • Onboarding – how to write proper step definitions, features, scenario outlines, regex’s, etc.
  • 10. © Sauce Labs, Inc. Keyword Driven Testing (KDT) • Definition: Represent functionality to be tested as keywords which are executed in combination to model test behavior • Disadvantages: • Risk of dependency creation between keywords must be mitigated by design • Sometimes such dependencies are unavoidable • Maintenance costs are generally managed more by design than by technical savvy. • Addresses only application functionality rather than application objects • Requires additional design of an object recognition strategy • Advantages: • Strong and clear separation of design, data, and development • Capacity to understand test automation flow without much or any technical knowledge • Extreme abstraction of automation implementation
  • 11. © Sauce Labs, Inc. Why KDT? • Reasons to consider KDT: • Culture and support structure tending towards business driven test design • Separation of design, data, and development • Organizational structure will sometimes lend these three categories to different existing roles in the organization • Requirement to have non-programming personnel interact with test automation (design, execution, or analysis) • Very easy to data-drive tests • Reasons to explore other options: • Large amounts of dependent functionality • You can model workflows in KDT but complex workflows can present issues • Desire to keep test automation technical and reduce design overhead
  • 12. © Sauce Labs, Inc. KDT Sample and Further Discussion • Start with a generic keyword • Create a concept for an execution flow • Make sure keyword execution can handle exception cases • Devise a strategy for sharing data between keywords and/or tests
  • 13. © Sauce Labs, Inc. KDT Sample and Further Discussion • Create the core of the framework that enables execution of tests • Create a primary driver class which can parse your input (driven by spreadsheet, xml files, JSON, etc.) • Control execution flow at the highest level here. Have a hierarchy of classes to support each level (Test Cases, Keywords, etc.) • The most light weight means of execution will be driving it through a main method and simply invoking it from the command line • Reflection is your friend
  • 14. © Sauce Labs, Inc. KDT Sample and Further Discussion • With the core framework in place, build useful and reusable keywords • This is a prototype for a keyword that manages connections • Create an abstract class which manages connection creation/reuse during initialization • And manages connection cleanup/rollback during cleanup
  • 15. © Sauce Labs, Inc. KDT Sample and Further Discussion • Create simple keywords leveraging abstract functionality • Keywords that perform a specific task should perform ONLY that task whenever possible • A specific keyword implementation should only care about the arguments unique to it • Reduce maintenance costs by eliminating boiler plate or common code
  • 16. © Sauce Labs, Inc. Summary • Key Takeaways • Design, design, design • Focus on reducing maintenance costs • Choose the best fit
  • 17. © Sauce Labs, Inc. Questions?
  • 18. © Sauce Labs, Inc. More Info on Sauce Labs Resources • WhitePaper: How to get the most out of your CI / CD work flow with automated testing http://tinyurl.com/p5umo6p • Sauce Labs Docs – tutorials for writing scripts https://docs.saucelabs.com/ • Sign up for a free trial of Sauce https://saucelabs.com/signup/trial
  • 19. © Sauce Labs, Inc. More Info QualiTest Resources • Check us out! http://www.qualitestgroup.com • See some stories of what we have done with Selenium! http://www.qualitestgroup.com/software-testing/testing-services-through-selenium/
  • 20. © Sauce Labs, Inc. Thank you!

Notes de l'éditeur

  1. Don’t forget to talk about why purely scripted is bad and you need to pick SOMETHING