SlideShare a Scribd company logo
Designing for the Internet
Page Objects for the Real World
Intro
| Christopher Livett – Solution Architect
| Working with QualiTest UK for 8 years
| Specialist in test automation, performance
testing and leading technical delivery
| Helped define and implement numerous
test automation solutions using a variety of
tools, frameworks and languages
| Experienced in implementing Continuous
Integration, Continuous Delivery and
DevOps processes.
2
Introducing the Page Object Model
3
What is a
Page Object
Model?
| A pattern for modeling the UI components of an application as
objects to be consumed by test code
| Provides the test with a representation of the services offered
by a page
| Contains the deep knowledge of the structure of the HTML of
a page and its components
| Abstracts the test logic away from direct interaction with the
WebDriver API and System-Under-Test wherever possible.
4
Why Page
Object
Model?
| Expose page and component services rather than mechanics
| Write concise tests that exercise functionality, not technical
details
| Create maintainable tests by isolating the effect of UI change
on test code
| Produce readable tests by keeping implementation details out
of test code.
5
Layers of Abstraction
| Tests are comprised of steps
| Steps interact with pages
| Pages provide services and key components
| Operations on pages occur without any
knowledge of page structure
| Pages are comprised of elements
| Each element represents a single item on
a page that can be interacted with
| Text, buttons, fields, images, etc.
6
Steps
Pages
Elements
Tests
Design Considerations
| PageObject base class
| Interface with Selenium’s PageObjectFactory
| Provides easy access to the WebDriver
instance it is created with
| Optionally provision for detecting that the page
has loaded properly
| All Page Objects should be derived from
this base class
| Not all pages should be represented in
their entirety by a Page Object.
| Components
| Web applications may consist of lots of
elements on a single page, or no clear
distinction of “pages”
| Instead of a Page Object representing a whole
page, it can represent a component on a page
| Judgement as to whether to use pages,
components, or both
| No Page Object should be “bigger than
your head”
| https://gist.github.com/RiverGlide/7718ab70f9
d1ee0eddbf8bcf95887555.
7
Page Object Model vs Screenplay Pattern
8
Page Object vs Screenplay
| Page Object
| Model for abstracting implementation from
logic
| Most commonly used standard in test
automation
| Has been used in very large, stable solutions
| Designed to reduce code duplication,
encourage code re-use and make tests more
maintainable
| Does not strictly follow SOLID principles.
| Screenplay
| Design pattern for writing human-readable
tests with layers of abstraction
| Comprised of:
• Actors – Who is using the system
• Tasks – What are they doing
• Actions – How are they going to do it
• Web Pages – Where are the elements they need
| Breaks Page Objects in to Actions and Web
Pages
| Adheres more closely to SOLID principles.
9
Page Object
vs
Screenplay
continued
| Purpose of today is not debate Page Object vs Screenplay
| Both have proven to be viable solutions for writing
maintainable automated tests
| Principles learned in writing good quality Page Objects can be
refactored into Screenplay tests.
10
11
Introducing
| Demonstrating the Page Object model requires a testing
framework
| Serenity is an open source Java (and recently JavaScript)
library to speed up writing tests; including:
| Complete WebDriver testing framework
| Parallel execution of tests using JUnit, Cucumber or JBehave
| Integration with SauceLabs, Jira, and other testing tools
| Detailed reporting
| Supports both the Page Object and Screenplay pattern
| Well used across the industry.
12
Creating our first test
| Introducing creating a Serenity test from
scratch
| Test:
| Given I start on the form authentication page
When I log in as Tom Smith
Then I see the secure area
| Framework:
| Serenity, Selenium, JUnit and Maven
| Execute on single Chrome instance
| Hard-coded test data
13
Steps
FormAuthenticationSteps
Pages
FormAuthenticationPage
SecureAreaPage
Elements
usernameField
passwordField
etc.
Test
FormAuthentication
Demonstration 1:
Creating the authentication test
14
Challenging Page Object Models
15
Tables
| Common tasks
| Iteration
| Query for rows
| Sorting
| Row actions (like clicking edit or delete
buttons)
| Common Challenges
| Lack of unique identifiers
| Lack of relationships between column headers
and cells within rows
| Index and other related math can make code
messy.
16
Potential
Solutions
| Complex CSS or XPATH for finding data
| E.g. //table[@id=’table1']//tr[td//text()[contains(., '{0}')]]/td[3]
| Fast, re-usable and can be extended to find data within the table
| Difficult to create, read and update on change
| Parse whole table
| Cycle through each row, storing all data in to the ‘Row’ object
| Table object can then be stored and passed around to be usable by
code
| Slow to do 1st capture and requires re-capture on change
| Easy to use, understand, update
| Row iterator
| Similar to parsing whole table
| Parse row-by-row as needed until needed data found
| Speed depends on how much data is required.
17
Demonstration 2:
Table row iterator
18
Frames
| Common tasks
| Interacting with nested frames
| Interacting with iFrames
| Switching between pages and frames
| Common Challenges
| Frames can be from different sources
| iFrames may need to be loaded
| Needing to move back outside of frames.
19
Demonstration 3:
Handling iFrames
20
Dynamic Pages
| Many systems are dynamic by nature
| Thick client (Angular, JQuery)
| CMS
| Systems may not be made with testing in
mind
| Common Challenges
| IDs and classes may change each page load
or change
| Elements may move on the page
| Tests may change the page for other tests.
21
Demonstration 4:
Changing Buttons
22
JQuery
| JQuery and similar libraries introduce
complex behaviours to websites
| Almost endless possibility of features that
can prove challenging for test automation
| Common Challenges
| Lazy loading / infinite scrolling
| Hover actions
| Hidden elements
23
Demonstration 5:
Mouse-over elements and file downloads
24
Demonstration 6:
Infinite Scroll
25
HTML5 Video Player
| Common Tasks
| Play
| Pause
| Control volume
| Seeking
| Reload video
| Checking state
| Common challenges
| Video controls may not be interacted with by
WebDriver
| Controls may have difficult to identify selectors
| Videos may be in different states.
26
Demonstration 6:
Controlling YouTube videos
27
Conclusion
| We have shown one solution to each problem
| Different websites and situations may require different
solutions
| Complex pages could and should be broken into
‘Components’
| Page Objects may not be the perfect solution
| Easily become large and complex
| Can be difficult to maintain
| Break SOLID principles
| but:
| They provide abstraction of logic and implementation
| Allow creating unique solutions to unique problems
| Can be easily understood, created and updated.
28
29
www.QualiTestGroup.com
Thank You

More Related Content

What's hot

DevOps the Big Picture for Testers by Joseph Ours
DevOps the Big Picture for Testers by Joseph OursDevOps the Big Picture for Testers by Joseph Ours
DevOps the Big Picture for Testers by Joseph Ours
QA or the Highway
 
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
 Delivering Java Applications? Ensure Top Performance Every Time, with Intell... Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
John Williams
 
How-To-Guide for Software Security Vulnerability Remediation
How-To-Guide for Software Security Vulnerability RemediationHow-To-Guide for Software Security Vulnerability Remediation
How-To-Guide for Software Security Vulnerability Remediation
Denim Group
 
DevOps adoption in the enterprise
DevOps adoption in the enterpriseDevOps adoption in the enterprise
DevOps adoption in the enterprise
Sanjeev Sharma
 
Maturing your path toward DevOps with Continuous Testing
Maturing your path toward DevOps with Continuous TestingMaturing your path toward DevOps with Continuous Testing
Maturing your path toward DevOps with Continuous Testing
Perfecto Mobile
 
End to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOpsEnd to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOps
eG Innovations
 
DevopsBusinessCaseTemplate
DevopsBusinessCaseTemplateDevopsBusinessCaseTemplate
DevopsBusinessCaseTemplatePeter Lamar
 
Automating API Generation and DevOps Pipeline for On-Prem Systems
Automating API Generation and DevOps Pipeline for  On-Prem SystemsAutomating API Generation and DevOps Pipeline for  On-Prem Systems
Automating API Generation and DevOps Pipeline for On-Prem Systems
DevOps.com
 
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
Andrew Williams
 
DevOps 101 - IBM Impact 2014
DevOps 101 - IBM Impact 2014 DevOps 101 - IBM Impact 2014
DevOps 101 - IBM Impact 2014
Sanjeev Sharma
 
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
Michael Kehoe
 
What is DevOps? - ITSM Academy Webinar
What is DevOps?  - ITSM Academy Webinar What is DevOps?  - ITSM Academy Webinar
What is DevOps? - ITSM Academy Webinar
ITSM Academy, Inc.
 
Continuous Delivery Maturity Model
Continuous Delivery Maturity ModelContinuous Delivery Maturity Model
Continuous Delivery Maturity Model
IBM UrbanCode Products
 
DevOps: From Adoption to Performance
DevOps: From Adoption to PerformanceDevOps: From Adoption to Performance
DevOps: From Adoption to Performance
Dynatrace
 
Enterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedInEnterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedInGary Stafford
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
OCTO Technology
 
Why DevOps Matters To The CIO
Why DevOps Matters To The CIOWhy DevOps Matters To The CIO
Why DevOps Matters To The CIO
benjaminwootton
 
XebiaLabs Overview Slides
XebiaLabs Overview SlidesXebiaLabs Overview Slides
XebiaLabs Overview Slides
XebiaLabs
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Matthew David
 
Easily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumEasily Create Scalable Automation using Selenium
Easily Create Scalable Automation using Selenium
Micro Focus
 

What's hot (20)

DevOps the Big Picture for Testers by Joseph Ours
DevOps the Big Picture for Testers by Joseph OursDevOps the Big Picture for Testers by Joseph Ours
DevOps the Big Picture for Testers by Joseph Ours
 
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
 Delivering Java Applications? Ensure Top Performance Every Time, with Intell... Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
 
How-To-Guide for Software Security Vulnerability Remediation
How-To-Guide for Software Security Vulnerability RemediationHow-To-Guide for Software Security Vulnerability Remediation
How-To-Guide for Software Security Vulnerability Remediation
 
DevOps adoption in the enterprise
DevOps adoption in the enterpriseDevOps adoption in the enterprise
DevOps adoption in the enterprise
 
Maturing your path toward DevOps with Continuous Testing
Maturing your path toward DevOps with Continuous TestingMaturing your path toward DevOps with Continuous Testing
Maturing your path toward DevOps with Continuous Testing
 
End to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOpsEnd to-End Monitoring for ITSM and DevOps
End to-End Monitoring for ITSM and DevOps
 
DevopsBusinessCaseTemplate
DevopsBusinessCaseTemplateDevopsBusinessCaseTemplate
DevopsBusinessCaseTemplate
 
Automating API Generation and DevOps Pipeline for On-Prem Systems
Automating API Generation and DevOps Pipeline for  On-Prem SystemsAutomating API Generation and DevOps Pipeline for  On-Prem Systems
Automating API Generation and DevOps Pipeline for On-Prem Systems
 
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
DevOps Workshop - Addressing Quality Challenges of Highly Complex and Integra...
 
DevOps 101 - IBM Impact 2014
DevOps 101 - IBM Impact 2014 DevOps 101 - IBM Impact 2014
DevOps 101 - IBM Impact 2014
 
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
SF Chaos Engineering Meetup: Building Disaster Recovery via Resilience Engine...
 
What is DevOps? - ITSM Academy Webinar
What is DevOps?  - ITSM Academy Webinar What is DevOps?  - ITSM Academy Webinar
What is DevOps? - ITSM Academy Webinar
 
Continuous Delivery Maturity Model
Continuous Delivery Maturity ModelContinuous Delivery Maturity Model
Continuous Delivery Maturity Model
 
DevOps: From Adoption to Performance
DevOps: From Adoption to PerformanceDevOps: From Adoption to Performance
DevOps: From Adoption to Performance
 
Enterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedInEnterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedIn
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Why DevOps Matters To The CIO
Why DevOps Matters To The CIOWhy DevOps Matters To The CIO
Why DevOps Matters To The CIO
 
XebiaLabs Overview Slides
XebiaLabs Overview SlidesXebiaLabs Overview Slides
XebiaLabs Overview Slides
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Easily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumEasily Create Scalable Automation using Selenium
Easily Create Scalable Automation using Selenium
 

Similar to Designing for the internet - Page Objects for the Real World

Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
Keyur Shah
 
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
Mikalai Alimenkou
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
Ganuka Yashantha
 
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестамDSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
SQALab
 
Priyanka_3.5years_Resume
Priyanka_3.5years_ResumePriyanka_3.5years_Resume
Priyanka_3.5years_ResumePriyanka Banda
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
SQALab
 
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Esraa Farrag
 
Designing a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutionsDesigning a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutions
QUONTRASOLUTIONS
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Sargis Sargsyan
 
Test Automation Framework Online Training by QuontraSolutions
Test Automation Framework Online Training by QuontraSolutionsTest Automation Framework Online Training by QuontraSolutions
Test Automation Framework Online Training by QuontraSolutions
Quontra Solutions
 
WebMate: A Tool for Testing Web 2.0 Applications
WebMate: A Tool for Testing Web 2.0 ApplicationsWebMate: A Tool for Testing Web 2.0 Applications
WebMate: A Tool for Testing Web 2.0 Applications
AnwarrChaudary
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sitesjoelabrahamsson
 
Web and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 UltimateWeb and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 Ultimate
Abhimanyu Singhal
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
Red Pill Now
 
An easy way to automate complex UI
An easy way to automate complex UIAn easy way to automate complex UI
An easy way to automate complex UI
Ivan Pashko
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
QA or the Highway
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
Florian Fesseler
 

Similar to Designing for the internet - Page Objects for the Real World (20)

Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
 
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестамDSL, Page Object и WebDriver – путь к надежным функциональным тестам
DSL, Page Object и WebDriver – путь к надежным функциональным тестам
 
Priyanka_3.5years_Resume
Priyanka_3.5years_ResumePriyanka_3.5years_Resume
Priyanka_3.5years_Resume
 
Mayur_Resume (2) (1)
Mayur_Resume (2) (1)Mayur_Resume (2) (1)
Mayur_Resume (2) (1)
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
Web Engineering: A Practitioner Approach -Testing web app - Content Managemen...
 
Designing a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutionsDesigning a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutions
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
 
Test Automation Framework Online Training by QuontraSolutions
Test Automation Framework Online Training by QuontraSolutionsTest Automation Framework Online Training by QuontraSolutions
Test Automation Framework Online Training by QuontraSolutions
 
WebMate: A Tool for Testing Web 2.0 Applications
WebMate: A Tool for Testing Web 2.0 ApplicationsWebMate: A Tool for Testing Web 2.0 Applications
WebMate: A Tool for Testing Web 2.0 Applications
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
Web and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 UltimateWeb and load testing with Visual Studio 2010 Ultimate
Web and load testing with Visual Studio 2010 Ultimate
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
 
An easy way to automate complex UI
An easy way to automate complex UIAn easy way to automate complex UI
An easy way to automate complex UI
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 

More from Qualitest

10 must do’s for perfect customer experience (Cx) -Qualitest
10 must do’s for perfect customer experience (Cx) -Qualitest10 must do’s for perfect customer experience (Cx) -Qualitest
10 must do’s for perfect customer experience (Cx) -Qualitest
Qualitest
 
Don’t Let Missed Bugs Cause Mayhem in your Organization!
Don’t Let Missed Bugs Cause Mayhem in your Organization!Don’t Let Missed Bugs Cause Mayhem in your Organization!
Don’t Let Missed Bugs Cause Mayhem in your Organization!
Qualitest
 
DevOps and Groupthink An Oxymoron?
DevOps and Groupthink An Oxymoron?DevOps and Groupthink An Oxymoron?
DevOps and Groupthink An Oxymoron?
Qualitest
 
Google SLS Outsourcing by Jeffrey Roth
Google SLS Outsourcing by Jeffrey RothGoogle SLS Outsourcing by Jeffrey Roth
Google SLS Outsourcing by Jeffrey Roth
Qualitest
 
Successful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer GlanzSuccessful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer Glanz
Qualitest
 
Pricing Models by Michel Sharvit
Pricing Models by Michel SharvitPricing Models by Michel Sharvit
Pricing Models by Michel Sharvit
Qualitest
 
5 keys to success at MTS by Tzahi Falkovich
5 keys to success at MTS by Tzahi Falkovich5 keys to success at MTS by Tzahi Falkovich
5 keys to success at MTS by Tzahi Falkovich
Qualitest
 
The Journey of QualiTest by Ayal Zylberman
The Journey of QualiTest by Ayal ZylbermanThe Journey of QualiTest by Ayal Zylberman
The Journey of QualiTest by Ayal Zylberman
Qualitest
 
DevSecOps - It can change your life (cycle)
DevSecOps - It can change your life (cycle)DevSecOps - It can change your life (cycle)
DevSecOps - It can change your life (cycle)
Qualitest
 
IoT Quality Challenges - Testing & Engineering
IoT Quality Challenges - Testing & EngineeringIoT Quality Challenges - Testing & Engineering
IoT Quality Challenges - Testing & Engineering
Qualitest
 
Webinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QAWebinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QA
Qualitest
 
Root Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest GroupRoot Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest Group
Qualitest
 
Testing for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest GroupTesting for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest Group
Qualitest
 
DevOps 101
DevOps 101 DevOps 101
DevOps 101
Qualitest
 
Killing the Myths of Outsourced Software Testing
Killing the Myths of Outsourced Software TestingKilling the Myths of Outsourced Software Testing
Killing the Myths of Outsourced Software Testing
Qualitest
 
Why do we need a Scrum Master?
Why do we need a Scrum Master?Why do we need a Scrum Master?
Why do we need a Scrum Master?
Qualitest
 
How to Test Big Data Systems | QualiTest Group
How to Test Big Data Systems | QualiTest GroupHow to Test Big Data Systems | QualiTest Group
How to Test Big Data Systems | QualiTest Group
Qualitest
 
The changing role of a QA | QualiTest Group
The changing role of a QA | QualiTest GroupThe changing role of a QA | QualiTest Group
The changing role of a QA | QualiTest Group
Qualitest
 
Roaming Assurance | QualiTest Group
Roaming Assurance | QualiTest GroupRoaming Assurance | QualiTest Group
Roaming Assurance | QualiTest Group
Qualitest
 
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest GroupCrowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
Qualitest
 

More from Qualitest (20)

10 must do’s for perfect customer experience (Cx) -Qualitest
10 must do’s for perfect customer experience (Cx) -Qualitest10 must do’s for perfect customer experience (Cx) -Qualitest
10 must do’s for perfect customer experience (Cx) -Qualitest
 
Don’t Let Missed Bugs Cause Mayhem in your Organization!
Don’t Let Missed Bugs Cause Mayhem in your Organization!Don’t Let Missed Bugs Cause Mayhem in your Organization!
Don’t Let Missed Bugs Cause Mayhem in your Organization!
 
DevOps and Groupthink An Oxymoron?
DevOps and Groupthink An Oxymoron?DevOps and Groupthink An Oxymoron?
DevOps and Groupthink An Oxymoron?
 
Google SLS Outsourcing by Jeffrey Roth
Google SLS Outsourcing by Jeffrey RothGoogle SLS Outsourcing by Jeffrey Roth
Google SLS Outsourcing by Jeffrey Roth
 
Successful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer GlanzSuccessful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer Glanz
 
Pricing Models by Michel Sharvit
Pricing Models by Michel SharvitPricing Models by Michel Sharvit
Pricing Models by Michel Sharvit
 
5 keys to success at MTS by Tzahi Falkovich
5 keys to success at MTS by Tzahi Falkovich5 keys to success at MTS by Tzahi Falkovich
5 keys to success at MTS by Tzahi Falkovich
 
The Journey of QualiTest by Ayal Zylberman
The Journey of QualiTest by Ayal ZylbermanThe Journey of QualiTest by Ayal Zylberman
The Journey of QualiTest by Ayal Zylberman
 
DevSecOps - It can change your life (cycle)
DevSecOps - It can change your life (cycle)DevSecOps - It can change your life (cycle)
DevSecOps - It can change your life (cycle)
 
IoT Quality Challenges - Testing & Engineering
IoT Quality Challenges - Testing & EngineeringIoT Quality Challenges - Testing & Engineering
IoT Quality Challenges - Testing & Engineering
 
Webinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QAWebinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QA
 
Root Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest GroupRoot Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest Group
 
Testing for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest GroupTesting for a Great App and Web Experience | QualiTest Group
Testing for a Great App and Web Experience | QualiTest Group
 
DevOps 101
DevOps 101 DevOps 101
DevOps 101
 
Killing the Myths of Outsourced Software Testing
Killing the Myths of Outsourced Software TestingKilling the Myths of Outsourced Software Testing
Killing the Myths of Outsourced Software Testing
 
Why do we need a Scrum Master?
Why do we need a Scrum Master?Why do we need a Scrum Master?
Why do we need a Scrum Master?
 
How to Test Big Data Systems | QualiTest Group
How to Test Big Data Systems | QualiTest GroupHow to Test Big Data Systems | QualiTest Group
How to Test Big Data Systems | QualiTest Group
 
The changing role of a QA | QualiTest Group
The changing role of a QA | QualiTest GroupThe changing role of a QA | QualiTest Group
The changing role of a QA | QualiTest Group
 
Roaming Assurance | QualiTest Group
Roaming Assurance | QualiTest GroupRoaming Assurance | QualiTest Group
Roaming Assurance | QualiTest Group
 
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest GroupCrowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
Crowd Catcher: Take control of the Crowd (part 1 of 3) | QualiTest Group
 

Recently uploaded

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 

Recently uploaded (20)

2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 

Designing for the internet - Page Objects for the Real World

  • 1. Designing for the Internet Page Objects for the Real World
  • 2. Intro | Christopher Livett – Solution Architect | Working with QualiTest UK for 8 years | Specialist in test automation, performance testing and leading technical delivery | Helped define and implement numerous test automation solutions using a variety of tools, frameworks and languages | Experienced in implementing Continuous Integration, Continuous Delivery and DevOps processes. 2
  • 3. Introducing the Page Object Model 3
  • 4. What is a Page Object Model? | A pattern for modeling the UI components of an application as objects to be consumed by test code | Provides the test with a representation of the services offered by a page | Contains the deep knowledge of the structure of the HTML of a page and its components | Abstracts the test logic away from direct interaction with the WebDriver API and System-Under-Test wherever possible. 4
  • 5. Why Page Object Model? | Expose page and component services rather than mechanics | Write concise tests that exercise functionality, not technical details | Create maintainable tests by isolating the effect of UI change on test code | Produce readable tests by keeping implementation details out of test code. 5
  • 6. Layers of Abstraction | Tests are comprised of steps | Steps interact with pages | Pages provide services and key components | Operations on pages occur without any knowledge of page structure | Pages are comprised of elements | Each element represents a single item on a page that can be interacted with | Text, buttons, fields, images, etc. 6 Steps Pages Elements Tests
  • 7. Design Considerations | PageObject base class | Interface with Selenium’s PageObjectFactory | Provides easy access to the WebDriver instance it is created with | Optionally provision for detecting that the page has loaded properly | All Page Objects should be derived from this base class | Not all pages should be represented in their entirety by a Page Object. | Components | Web applications may consist of lots of elements on a single page, or no clear distinction of “pages” | Instead of a Page Object representing a whole page, it can represent a component on a page | Judgement as to whether to use pages, components, or both | No Page Object should be “bigger than your head” | https://gist.github.com/RiverGlide/7718ab70f9 d1ee0eddbf8bcf95887555. 7
  • 8. Page Object Model vs Screenplay Pattern 8
  • 9. Page Object vs Screenplay | Page Object | Model for abstracting implementation from logic | Most commonly used standard in test automation | Has been used in very large, stable solutions | Designed to reduce code duplication, encourage code re-use and make tests more maintainable | Does not strictly follow SOLID principles. | Screenplay | Design pattern for writing human-readable tests with layers of abstraction | Comprised of: • Actors – Who is using the system • Tasks – What are they doing • Actions – How are they going to do it • Web Pages – Where are the elements they need | Breaks Page Objects in to Actions and Web Pages | Adheres more closely to SOLID principles. 9
  • 10. Page Object vs Screenplay continued | Purpose of today is not debate Page Object vs Screenplay | Both have proven to be viable solutions for writing maintainable automated tests | Principles learned in writing good quality Page Objects can be refactored into Screenplay tests. 10
  • 11. 11
  • 12. Introducing | Demonstrating the Page Object model requires a testing framework | Serenity is an open source Java (and recently JavaScript) library to speed up writing tests; including: | Complete WebDriver testing framework | Parallel execution of tests using JUnit, Cucumber or JBehave | Integration with SauceLabs, Jira, and other testing tools | Detailed reporting | Supports both the Page Object and Screenplay pattern | Well used across the industry. 12
  • 13. Creating our first test | Introducing creating a Serenity test from scratch | Test: | Given I start on the form authentication page When I log in as Tom Smith Then I see the secure area | Framework: | Serenity, Selenium, JUnit and Maven | Execute on single Chrome instance | Hard-coded test data 13 Steps FormAuthenticationSteps Pages FormAuthenticationPage SecureAreaPage Elements usernameField passwordField etc. Test FormAuthentication
  • 14. Demonstration 1: Creating the authentication test 14
  • 16. Tables | Common tasks | Iteration | Query for rows | Sorting | Row actions (like clicking edit or delete buttons) | Common Challenges | Lack of unique identifiers | Lack of relationships between column headers and cells within rows | Index and other related math can make code messy. 16
  • 17. Potential Solutions | Complex CSS or XPATH for finding data | E.g. //table[@id=’table1']//tr[td//text()[contains(., '{0}')]]/td[3] | Fast, re-usable and can be extended to find data within the table | Difficult to create, read and update on change | Parse whole table | Cycle through each row, storing all data in to the ‘Row’ object | Table object can then be stored and passed around to be usable by code | Slow to do 1st capture and requires re-capture on change | Easy to use, understand, update | Row iterator | Similar to parsing whole table | Parse row-by-row as needed until needed data found | Speed depends on how much data is required. 17
  • 19. Frames | Common tasks | Interacting with nested frames | Interacting with iFrames | Switching between pages and frames | Common Challenges | Frames can be from different sources | iFrames may need to be loaded | Needing to move back outside of frames. 19
  • 21. Dynamic Pages | Many systems are dynamic by nature | Thick client (Angular, JQuery) | CMS | Systems may not be made with testing in mind | Common Challenges | IDs and classes may change each page load or change | Elements may move on the page | Tests may change the page for other tests. 21
  • 23. JQuery | JQuery and similar libraries introduce complex behaviours to websites | Almost endless possibility of features that can prove challenging for test automation | Common Challenges | Lazy loading / infinite scrolling | Hover actions | Hidden elements 23
  • 24. Demonstration 5: Mouse-over elements and file downloads 24
  • 26. HTML5 Video Player | Common Tasks | Play | Pause | Control volume | Seeking | Reload video | Checking state | Common challenges | Video controls may not be interacted with by WebDriver | Controls may have difficult to identify selectors | Videos may be in different states. 26
  • 28. Conclusion | We have shown one solution to each problem | Different websites and situations may require different solutions | Complex pages could and should be broken into ‘Components’ | Page Objects may not be the perfect solution | Easily become large and complex | Can be difficult to maintain | Break SOLID principles | but: | They provide abstraction of logic and implementation | Allow creating unique solutions to unique problems | Can be easily understood, created and updated. 28
  • 29. 29

Editor's Notes

  1. - Start with a blank framework - Begin by pages only having ‘enterUsername’, ’enterPassword’ and ‘submit’ methods, later refactor to include ’authenticate’ method which performs all three - Create test, implement first step, implement page, execute implement next step, implement pages, execute, repeat - Talk through aspects of the test - Show report once test fully passing
  2. - Create a Row class within the Table page - Create a method to get all row elements by FindElements - Create a method to get an individual user by passing in each rowElement 1-by-1 and returning the found row - Show complete page object being used in tests