Selenium Page Objects101

26,226 views

Published on

Page Objects are a way of representing a page in an OO manner. This presentation introduces an implementation of the pattern and its components.

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
26,226
On SlideShare
0
From Embeds
0
Number of Embeds
17,380
Actions
Shares
0
Downloads
72
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Selenium Page Objects101

  1. 1. Page Objects 101 Adam Goucher @adamgoucher adam@element34.caWednesday, July 27, 2011
  2. 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. 3 [Big] Reasons 1.Maintenance 2.Readability of Scripts 3.Separation of ConcernsWednesday, July 27, 2011
  4. 4. Scripts & Page ObjectsWednesday, July 27, 2011
  5. 5. Page ObjectsWednesday, July 27, 2011
  6. 6. Locators • A specific locator appears only once in your entire set of PO • Locators do not cross PO boundariesWednesday, July 27, 2011
  7. 7. Elements • Anything directly interacted with [via Selenium] is an Element • Elements override Get/SetWednesday, July 27, 2011
  8. 8. Tip - Create common base classes for ElementsWednesday, July 27, 2011
  9. 9. Actions • Repeated series of commands • [Usually] Named with verbs • [Often] Require SyncWednesday, July 27, 2011
  10. 10. Synchronization • In Synchronization • Out Synchronization • ‘Flag’ drivenWednesday, July 27, 2011
  11. 11. Tip - Create custom wait_for_* method in a common base POWednesday, July 27, 2011
  12. 12. Order of Operations 1.Locator 2.Element Implementation 3.Add Element to Page Object 4.ActionsWednesday, July 27, 2011
  13. 13. Tip - Do NOT create the whole PO at once. Do ONLY what you need now.Wednesday, July 27, 2011
  14. 14. Asserts do not belong in POWednesday, July 27, 2011
  15. 15. ScriptsWednesday, July 27, 2011
  16. 16. Do not have synchronization codeWednesday, July 27, 2011
  17. 17. Do not have driver API callsWednesday, July 27, 2011
  18. 18. Do have interactions with POWednesday, July 27, 2011
  19. 19. Do have assertsWednesday, July 27, 2011

×