SlideShare ist ein Scribd-Unternehmen logo
1 von 30
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 OursQA 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 RemediationDenim Group
 
DevOps adoption in the enterprise
DevOps adoption in the enterpriseDevOps adoption in the enterprise
DevOps adoption in the enterpriseSanjeev 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 TestingPerfecto 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 DevOpseG 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 SystemsDevOps.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.
 
DevOps: From Adoption to Performance
DevOps: From Adoption to PerformanceDevOps: From Adoption to Performance
DevOps: From Adoption to PerformanceDynatrace
 
Enterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedInEnterprise DevOps Adoption LinkedIn
Enterprise DevOps Adoption LinkedInGary Stafford
 
Why DevOps Matters To The CIO
Why DevOps Matters To The CIOWhy DevOps Matters To The CIO
Why DevOps Matters To The CIObenjaminwootton
 
XebiaLabs Overview Slides
XebiaLabs Overview SlidesXebiaLabs Overview Slides
XebiaLabs Overview SlidesXebiaLabs
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOpsMatthew David
 
Easily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumEasily Create Scalable Automation using Selenium
Easily Create Scalable Automation using SeleniumMicro Focus
 

Was ist angesagt? (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
 

Ähnlich wie 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 WebinarKeyur 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.pptxMikalai Alimenkou
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka 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 PatternSQALab
 
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 solutionsQUONTRASOLUTIONS
 
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 QuontraSolutionsQuontra 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 ApplicationsAnwarrChaudary
 
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 UltimateAbhimanyu 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 PatternSargis Sargsyan
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web ComponentsRed 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 UIIvan 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 DahalQA or the Highway
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to ProtractorFlorian Fesseler
 

Ähnlich wie 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
 

Mehr von 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) -QualitestQualitest
 
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 RothQualitest
 
Successful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer GlanzSuccessful Offshore Practices by Ofer Glanz
Successful Offshore Practices by Ofer GlanzQualitest
 
Pricing Models by Michel Sharvit
Pricing Models by Michel SharvitPricing Models by Michel Sharvit
Pricing Models by Michel SharvitQualitest
 
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 FalkovichQualitest
 
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 ZylbermanQualitest
 
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 & EngineeringQualitest
 
Webinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QAWebinar: DevOps challenges facing QA
Webinar: DevOps challenges facing QAQualitest
 
Root Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest GroupRoot Cause Analysis | QualiTest Group
Root Cause Analysis | QualiTest GroupQualitest
 
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 GroupQualitest
 
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 TestingQualitest
 
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 GroupQualitest
 
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 GroupQualitest
 
Roaming Assurance | QualiTest Group
Roaming Assurance | QualiTest GroupRoaming Assurance | QualiTest Group
Roaming Assurance | QualiTest GroupQualitest
 
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 GroupQualitest
 

Mehr von 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
 

Kürzlich hochgeladen

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
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 ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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 GoalsJhone kinadey
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
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 WorkerThousandEyes
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Kürzlich hochgeladen (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
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
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

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

Hinweis der Redaktion

  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