SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Page Objects
                               101
                              Adam Goucher
                              @adamgoucher
                            adam@element34.ca




Wednesday, July 27, 2011
A language neutral pattern for
                     representing a complete page
                       or portion of a page in an
                       Object Oriented manner.



Wednesday, July 27, 2011
3 [Big] Reasons

                1.Maintenance
                2.Readability of Scripts
                3.Separation of Concerns


Wednesday, July 27, 2011
Scripts & Page Objects



Wednesday, July 27, 2011
Page Objects



Wednesday, July 27, 2011
Locators

                    •      A specific locator appears
                           only once in your entire set
                           of PO
                    •      Locators do not cross PO
                           boundaries

Wednesday, July 27, 2011
Elements

                    •      Anything directly interacted
                           with [via Selenium] is an
                           Element
                    • Elements override Get/Set
Wednesday, July 27, 2011
Tip - Create common
                         base classes for
                             Elements


Wednesday, July 27, 2011
Actions

                    •      Repeated series of
                           commands
                    •      [Usually] Named with verbs
                    • [Often] Require Sync
Wednesday, July 27, 2011
Synchronization

                    •      In Synchronization
                    • Out Synchronization
                    • ‘Flag’ driven


Wednesday, July 27, 2011
Tip - Create custom
                 wait_for_* method in a
                   common base PO


Wednesday, July 27, 2011
Order of Operations

                     1.Locator
                     2.Element Implementation
                     3.Add Element to Page Object
                     4.Actions

Wednesday, July 27, 2011
Tip - Do NOT create
                    the whole PO at once.
                     Do ONLY what you
                           need now.
Wednesday, July 27, 2011
Asserts do not belong
                             in PO


Wednesday, July 27, 2011
Scripts



Wednesday, July 27, 2011
Do not have
                       synchronization code


Wednesday, July 27, 2011
Do not have driver API
                          calls


Wednesday, July 27, 2011
Do have interactions
                                with PO


Wednesday, July 27, 2011
Do have asserts



Wednesday, July 27, 2011

Weitere ähnliche Inhalte

Andere mochten auch

Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBay
Dominik Dary
 

Andere mochten auch (6)

JUnit Kung Fu: Getting More Out of Your Unit Tests
JUnit Kung Fu: Getting More Out of Your Unit TestsJUnit Kung Fu: Getting More Out of Your Unit Tests
JUnit Kung Fu: Getting More Out of Your Unit Tests
 
Continuous Integration, the minimum viable product
Continuous Integration, the minimum viable productContinuous Integration, the minimum viable product
Continuous Integration, the minimum viable product
 
Selenium Users Anonymous
Selenium Users AnonymousSelenium Users Anonymous
Selenium Users Anonymous
 
Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBay
 
Continuous Deployment - Lean LA
Continuous Deployment - Lean LAContinuous Deployment - Lean LA
Continuous Deployment - Lean LA
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance Tests
 

Ähnlich wie Selenium Page Objects101

2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore
ikailan
 
MDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make somethingMDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make something
Boulder Digital Works at CU
 
Creating common assessments in Limelight
Creating common assessments in LimelightCreating common assessments in Limelight
Creating common assessments in Limelight
Terri Sallee
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
Leonardo Borges
 

Ähnlich wie Selenium Page Objects101 (19)

2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore2011 july-gtug-high-replication-datastore
2011 july-gtug-high-replication-datastore
 
Yeswecan
YeswecanYeswecan
Yeswecan
 
MDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make somethingMDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make something
 
David Mytton, Boxed Ice
David Mytton, Boxed Ice   David Mytton, Boxed Ice
David Mytton, Boxed Ice
 
Alternative Software Development Methodology
Alternative Software Development MethodologyAlternative Software Development Methodology
Alternative Software Development Methodology
 
Agile xptdd@gosoft
Agile xptdd@gosoftAgile xptdd@gosoft
Agile xptdd@gosoft
 
Agile xp tdd@gosoft
Agile xp tdd@gosoftAgile xp tdd@gosoft
Agile xp tdd@gosoft
 
Ruby can haz Everyone
Ruby can haz EveryoneRuby can haz Everyone
Ruby can haz Everyone
 
Namesmatter
NamesmatterNamesmatter
Namesmatter
 
Когда хуже - лучше
Когда хуже - лучшеКогда хуже - лучше
Когда хуже - лучше
 
Atlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide Deck
 
Building an experimentation framework
Building an experimentation frameworkBuilding an experimentation framework
Building an experimentation framework
 
Replacing Telco DB/DW to Hadoop and Hive
Replacing Telco DB/DW to Hadoop and HiveReplacing Telco DB/DW to Hadoop and Hive
Replacing Telco DB/DW to Hadoop and Hive
 
Creating common assessments in Limelight
Creating common assessments in LimelightCreating common assessments in Limelight
Creating common assessments in Limelight
 
Node Stream
Node StreamNode Stream
Node Stream
 
Erlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systemsErlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systems
 
Beyond Page Objects
Beyond Page ObjectsBeyond Page Objects
Beyond Page Objects
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
 
Rails Admin - Guru SP
Rails Admin - Guru SPRails Admin - Guru SP
Rails Admin - Guru SP
 

Mehr von Adam Goucher

Mehr von Adam Goucher (20)

Lightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation HeuristicsLightsabers, Time Machines and other Automation Heuristics
Lightsabers, Time Machines and other Automation Heuristics
 
SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"SeleniumConf London 2019 - "Part 3: Practice what you Preach"
SeleniumConf London 2019 - "Part 3: Practice what you Preach"
 
Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?Is your Automation Infrastructure ‘Well Architected’?
Is your Automation Infrastructure ‘Well Architected’?
 
Your Job Is To Collect Stories
Your Job Is To Collect StoriesYour Job Is To Collect Stories
Your Job Is To Collect Stories
 
[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat Style[Automation] Trick-or-Treat Style
[Automation] Trick-or-Treat Style
 
Proxy and Executor
Proxy and ExecutorProxy and Executor
Proxy and Executor
 
Maintainable Automation FTW
Maintainable Automation FTWMaintainable Automation FTW
Maintainable Automation FTW
 
Selenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-ySelenium IDE - The future if plugin-y
Selenium IDE - The future if plugin-y
 
You're doing it wrong
You're doing it wrongYou're doing it wrong
You're doing it wrong
 
Everything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from PiratesEverything I learned about Agile I learned from Pirates
Everything I learned about Agile I learned from Pirates
 
Agile Test Case Management
Agile Test Case ManagementAgile Test Case Management
Agile Test Case Management
 
Mitigation
MitigationMitigation
Mitigation
 
The Many Hats of a Tester
The Many Hats of a TesterThe Many Hats of a Tester
The Many Hats of a Tester
 
Testing inspiration
Testing inspirationTesting inspiration
Testing inspiration
 
Archetypes
ArchetypesArchetypes
Archetypes
 
Agile Hats Art Show
Agile Hats Art ShowAgile Hats Art Show
Agile Hats Art Show
 
Quality through the lens of Astrophysics
Quality through the lens of AstrophysicsQuality through the lens of Astrophysics
Quality through the lens of Astrophysics
 
Legend of Zealot Anarchist Robot
Legend of Zealot Anarchist RobotLegend of Zealot Anarchist Robot
Legend of Zealot Anarchist Robot
 
Scripting Recipes KWSQA2009
Scripting Recipes KWSQA2009Scripting Recipes KWSQA2009
Scripting Recipes KWSQA2009
 
Scripting Recipes for Testers
Scripting Recipes for TestersScripting Recipes for Testers
Scripting Recipes for Testers
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Selenium Page Objects101

  • 1. Page Objects 101 Adam Goucher @adamgoucher adam@element34.ca Wednesday, July 27, 2011
  • 2. A language neutral pattern for representing a complete page or portion of a page in an Object Oriented manner. Wednesday, July 27, 2011
  • 3. 3 [Big] Reasons 1.Maintenance 2.Readability of Scripts 3.Separation of Concerns Wednesday, July 27, 2011
  • 4. Scripts & Page Objects Wednesday, July 27, 2011
  • 6. Locators • A specific locator appears only once in your entire set of PO • Locators do not cross PO boundaries Wednesday, July 27, 2011
  • 7. Elements • Anything directly interacted with [via Selenium] is an Element • Elements override Get/Set Wednesday, July 27, 2011
  • 8. Tip - Create common base classes for Elements Wednesday, July 27, 2011
  • 9. Actions • Repeated series of commands • [Usually] Named with verbs • [Often] Require Sync Wednesday, July 27, 2011
  • 10. Synchronization • In Synchronization • Out Synchronization • ‘Flag’ driven Wednesday, July 27, 2011
  • 11. Tip - Create custom wait_for_* method in a common base PO Wednesday, July 27, 2011
  • 12. Order of Operations 1.Locator 2.Element Implementation 3.Add Element to Page Object 4.Actions Wednesday, July 27, 2011
  • 13. Tip - Do NOT create the whole PO at once. Do ONLY what you need now. Wednesday, July 27, 2011
  • 14. Asserts do not belong in PO Wednesday, July 27, 2011
  • 16. Do not have synchronization code Wednesday, July 27, 2011
  • 17. Do not have driver API calls Wednesday, July 27, 2011
  • 18. Do have interactions with PO Wednesday, July 27, 2011
  • 19. Do have asserts Wednesday, July 27, 2011