Contenu connexe
Similaire à Selenium Page Objects101 (19)
Plus de Adam Goucher (20)
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
- 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
- 16. Do not have
synchronization code
Wednesday, July 27, 2011
- 17. Do not have driver API
calls
Wednesday, July 27, 2011