SlideShare a Scribd company logo
Web Test Automation
PAGE OBJECT PATTERN FOR SELENIUM TESTS
Selenium-Based Test Automation
• Overview
• Page Objects
• Some ‘prefer’ items
• Some Challenges
• A new way
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Overview
• We need to assertively test web applications
• Web applications involve significant business workflows
• Web applications involve more rather than less pages
• Test automation is a project concern
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Page Objects
• Page Objects are a pattern for Page classes
• See: https://www.martinfowler.com/bliki/PageObject.html
• Each page in a targetWeb application requires a Page Object class
• Provide a clear separation of «page code» from «test code»
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Prefer Items
• When automatingWebApplication tests, we would prefer to:
• Maximise separation of «page code» from «test code»
• Maximise maintainability and scalability of test collections
• Attack challenging business workflow
• Do more rather than less testing
• Participate in Continuous Integration
• Participate in Agile projects (Stories,Tasks, Stand-Ups, Demo’s)
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Challenges
• When automatingWebApplication tests, the challenges are:
• Achieving, routinely, a strong separation of «page code» from «test code»
• Being able to routinely deal challenging business workflow
• Developing tests as well as Page Objects, with confidence
• Going for the «more rather than less» proposition
• Participate in Agile projects given the test dev. time/effort involved
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
The New Way
Generation of Page Objects
• Pages
• Page ‘content’
Step 1
Definition
• Read Definition
• Write PO
Classes
Step 2
Generate • Write tests
• Use PO classes
Step 3Test
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Outcome
• With the new generational approach:
• Achieved -> a strong separation of «page code» from «test code»
• Achieved -> being able to routinely deal with challenging business workflow
• Achieved -> developing tests as well as Page Objects, with confidence
• Achieved -> going for the «more rather than less» proposition
• Achieved -> Able to participate fully inAgile projects
• Achieved -> maintainable, scalable and accessible test automation codebase
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Definition File
This definition file is for the
hypothetical testing of
Lufthansa.com.This site is public
and doesn’t like Roots 
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Generation
This shows the generation of the
Page Object classes. Some page
definitions are “empty” so don’t
have output. For real tests there
would be many more Pages.
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
Write Tests
This shows the a fragment of a test
which uses the generated Page
Objects.This test asserts the
existence and associated content of
the Main Page footer items.
(c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]

More Related Content

PPTX
Letter and Portfolio Builder Tools
PPTX
SPO Migration - New API
PPTX
Top 7 mistakes
PPTX
Ensuring Successful Office 365 Tenant to Tenant Migration SPS Cambridge 2017...
PPTX
Top 3 Mistakes when Building
PPTX
Building high performance and scalable share point applications
PPTX
Custom Development in SharePoint – What are my options now?
PPTX
Cloud-Based App Development using SharePoint 2013, Office 365 and Azure
Letter and Portfolio Builder Tools
SPO Migration - New API
Top 7 mistakes
Ensuring Successful Office 365 Tenant to Tenant Migration SPS Cambridge 2017...
Top 3 Mistakes when Building
Building high performance and scalable share point applications
Custom Development in SharePoint – What are my options now?
Cloud-Based App Development using SharePoint 2013, Office 365 and Azure

What's hot (20)

PPTX
Road to the Cloud - Extending your reach with SharePoint and Office 365
PPTX
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
PPTX
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
PPTX
Building solutions with Office Graph
PDF
New Features in the Evoq CMS
 
PPTX
Presentation on Windows 8 Application at IIT, University of Dhaka
PPTX
Building the Perfect Office 365 Tenant - SharePoint Saturday Belgium 2017 #SPSBE
PDF
How to Make the Most of Google Analytics on Your Evoq Site
 
PPTX
Data harmony update 2021
PPTX
I03 migration from on premises to office365 - tips tricks and hows
PPTX
Changing the way you work with Modern SharePoint Team Sites and Office 365 Gr...
PPTX
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
PPTX
Angular js Online Training
PDF
Angular js
PDF
O365Engage17 - Building portals with microsoft graph api
PPTX
Content migration for sitecore
PPTX
Optimizing SharePoint 2010 websites for search engines
PPTX
DIWUG.nl: How We Did It
PPTX
Drupal's path from 4 to 8
PDF
Hopkins Leveraging XML to Enhance Semantic Value of Standards
Road to the Cloud - Extending your reach with SharePoint and Office 365
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
Building solutions with Office Graph
New Features in the Evoq CMS
 
Presentation on Windows 8 Application at IIT, University of Dhaka
Building the Perfect Office 365 Tenant - SharePoint Saturday Belgium 2017 #SPSBE
How to Make the Most of Google Analytics on Your Evoq Site
 
Data harmony update 2021
I03 migration from on premises to office365 - tips tricks and hows
Changing the way you work with Modern SharePoint Team Sites and Office 365 Gr...
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
Angular js Online Training
Angular js
O365Engage17 - Building portals with microsoft graph api
Content migration for sitecore
Optimizing SharePoint 2010 websites for search engines
DIWUG.nl: How We Did It
Drupal's path from 4 to 8
Hopkins Leveraging XML to Enhance Semantic Value of Standards
Ad

Similar to Web Test Automation (20)

PDF
Writing an extensible web testing framework ready for the cloud slide share
PDF
How To Use Selenium Successfully
PDF
Enterprise WordPress - Performance, Scalability and Redundancy
PDF
How To Use Selenium Successfully (Java Edition)
PPTX
Do's and don'ts for Office 365 development
PPT
Test Automation Framework Development Introduction
PDF
Docs Like Code: Strategies and Stories
PDF
How to use selenium successfully
PPTX
Rencore Webinar: SharePoint Customizations - the most overlooked road block t...
PPTX
Microservices Architecture for MEAN Applications using Serverless AWS
PPTX
New life inside monolithic application
PPTX
MongoDB.local Atlanta: MongoDB Stitch Tutorial
PPTX
Creating a Documentation Portal
PPTX
webdevelopment_6132030-lva1-app6891.pptx
PPTX
Microservices Architecture for Web Applications using Serverless Computing wi...
PDF
Mastering Test Automation: How to Use Selenium Successfully
PDF
Accessibility Testing - Using Asqatasun - Meetup Webinar
PDF
Web Development with HTML5, CSS3 & JavaScript
PPTX
Microservices Architecture for Content Management Systems using AWS Lambda an...
PPTX
Introduction to cypress in Angular (Chinese)
Writing an extensible web testing framework ready for the cloud slide share
How To Use Selenium Successfully
Enterprise WordPress - Performance, Scalability and Redundancy
How To Use Selenium Successfully (Java Edition)
Do's and don'ts for Office 365 development
Test Automation Framework Development Introduction
Docs Like Code: Strategies and Stories
How to use selenium successfully
Rencore Webinar: SharePoint Customizations - the most overlooked road block t...
Microservices Architecture for MEAN Applications using Serverless AWS
New life inside monolithic application
MongoDB.local Atlanta: MongoDB Stitch Tutorial
Creating a Documentation Portal
webdevelopment_6132030-lva1-app6891.pptx
Microservices Architecture for Web Applications using Serverless Computing wi...
Mastering Test Automation: How to Use Selenium Successfully
Accessibility Testing - Using Asqatasun - Meetup Webinar
Web Development with HTML5, CSS3 & JavaScript
Microservices Architecture for Content Management Systems using AWS Lambda an...
Introduction to cypress in Angular (Chinese)
Ad

More from David Harrison (20)

PDF
Test Automation for the Desktop : Part t2
PDF
Test Automation Framework for the Desktop
PDF
SchemaStudioTypeLandscape_Article.pdf
PDF
PhoenixRisingArticle.pdf
PDF
IntoTheNebulaArticle.pdf
PDF
Processor Refactoring.pdf
PDF
PagesToGo.pdf
PDF
IntoTheNebulaArticle.pdf
PDF
Generation_XSD_Article - Part 4.pdf
PDF
PhoenixRisingArticle.pdf
PDF
Generation_XSD_Article - Part 3.pdf
PDF
Generation_XSD_Article - Part 2.pdf
DOCX
Generation_XSD_Article.docx
PDF
Test data article
PDF
Flavours - Classic/Technical BDD
PDF
Babble article - Test Automation & Text Translation
PDF
Bdd Show and Tell
PDF
UI Testing Pattern
PPTX
Soap ui automation
PPTX
High sierra part 1
Test Automation for the Desktop : Part t2
Test Automation Framework for the Desktop
SchemaStudioTypeLandscape_Article.pdf
PhoenixRisingArticle.pdf
IntoTheNebulaArticle.pdf
Processor Refactoring.pdf
PagesToGo.pdf
IntoTheNebulaArticle.pdf
Generation_XSD_Article - Part 4.pdf
PhoenixRisingArticle.pdf
Generation_XSD_Article - Part 3.pdf
Generation_XSD_Article - Part 2.pdf
Generation_XSD_Article.docx
Test data article
Flavours - Classic/Technical BDD
Babble article - Test Automation & Text Translation
Bdd Show and Tell
UI Testing Pattern
Soap ui automation
High sierra part 1

Recently uploaded (20)

PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
Testing WebRTC applications at scale.pdf
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
DOCX
Unit-3 cyber security network security of internet system
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Introduction to Information and Communication Technology
PPTX
Internet___Basics___Styled_ presentation
PPT
tcp ip networks nd ip layering assotred slides
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Funds Management Learning Material for Beg
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
RPKI Status Update, presented by Makito Lay at IDNOG 10
522797556-Unit-2-Temperature-measurement-1-1.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx
Testing WebRTC applications at scale.pdf
Triggering QUIC, presented by Geoff Huston at IETF 123
introduction about ICD -10 & ICD-11 ppt.pptx
Unit-3 cyber security network security of internet system
Decoding a Decade: 10 Years of Applied CTI Discipline
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Tenda Login Guide: Access Your Router in 5 Easy Steps
Introduction to Information and Communication Technology
Internet___Basics___Styled_ presentation
tcp ip networks nd ip layering assotred slides
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Funds Management Learning Material for Beg
Introuction about ICD -10 and ICD-11 PPT.pptx
Job_Card_System_Styled_lorem_ipsum_.pptx
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
An introduction to the IFRS (ISSB) Stndards.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...

Web Test Automation

  • 1. Web Test Automation PAGE OBJECT PATTERN FOR SELENIUM TESTS
  • 2. Selenium-Based Test Automation • Overview • Page Objects • Some ‘prefer’ items • Some Challenges • A new way (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 3. Overview • We need to assertively test web applications • Web applications involve significant business workflows • Web applications involve more rather than less pages • Test automation is a project concern (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 4. Page Objects • Page Objects are a pattern for Page classes • See: https://www.martinfowler.com/bliki/PageObject.html • Each page in a targetWeb application requires a Page Object class • Provide a clear separation of «page code» from «test code» (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 5. Prefer Items • When automatingWebApplication tests, we would prefer to: • Maximise separation of «page code» from «test code» • Maximise maintainability and scalability of test collections • Attack challenging business workflow • Do more rather than less testing • Participate in Continuous Integration • Participate in Agile projects (Stories,Tasks, Stand-Ups, Demo’s) (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 6. Challenges • When automatingWebApplication tests, the challenges are: • Achieving, routinely, a strong separation of «page code» from «test code» • Being able to routinely deal challenging business workflow • Developing tests as well as Page Objects, with confidence • Going for the «more rather than less» proposition • Participate in Agile projects given the test dev. time/effort involved (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 7. The New Way Generation of Page Objects • Pages • Page ‘content’ Step 1 Definition • Read Definition • Write PO Classes Step 2 Generate • Write tests • Use PO classes Step 3Test (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 8. Outcome • With the new generational approach: • Achieved -> a strong separation of «page code» from «test code» • Achieved -> being able to routinely deal with challenging business workflow • Achieved -> developing tests as well as Page Objects, with confidence • Achieved -> going for the «more rather than less» proposition • Achieved -> Able to participate fully inAgile projects • Achieved -> maintainable, scalable and accessible test automation codebase (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 9. Definition File This definition file is for the hypothetical testing of Lufthansa.com.This site is public and doesn’t like Roots  (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 10. Generation This shows the generation of the Page Object classes. Some page definitions are “empty” so don’t have output. For real tests there would be many more Pages. (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]
  • 11. Write Tests This shows the a fragment of a test which uses the generated Page Objects.This test asserts the existence and associated content of the Main Page footer items. (c) 2017 David Harrison All Rights Reserved [https://dharrisonch.com]