SlideShare una empresa de Scribd logo
1 de 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!

Más contenido relacionado

Destacado

Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016Cucumber_Fundamentals_12052016
Cucumber_Fundamentals_12052016
Michael Hughes
 
Continuous delivery mobile application development
Continuous delivery mobile application developmentContinuous delivery mobile application development
Continuous delivery mobile application development
Thoughtworks
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and Algorithms
Deiptii Das
 

Destacado (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
 

Más de Sauce 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 Scale
Sauce Labs
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
Sauce 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 Testing
Sauce Labs
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
Sauce Labs
 

Más 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
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

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!

Notas del editor

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