This document discusses the perils of using the page object pattern for test automation frameworks. It describes the page object pattern, how it can be used to model pages in code and reduce duplication. However, it also notes limitations like tests becoming too implementation focused rather than intent focused. It then introduces a business layer page object pattern that aims to address these limitations by validating business requirements and separating concerns with abstraction layers. This allows the test pyramid to remain balanced and makes maintenance and scaling easier.
17. If you keep the Automation
Framework Principles and
Practices in mind …
18. PRINCIPLES FOR A TEST AUTOMATION FRAMEWORK
Design
Patterns
Code quality
Abstraction Layers
Refactor, Evolve
& Extend
Pairing
19. PRACTICES FOR A TEST AUTOMATION FRAMEWORK
No Copy-Paste
Configurable
Continuous Integration (CI)
Test Data
Tools & Utilities
- Logging
- Screenshots
- Video
23. TIPS
Especially in Data / Locator heavy pages
Ø No getters / setters
Ø Logical grouping
Ø Handle waits
24. LIMITATIONS OF PAGE-OBJECT PATTERN
Test intent gets polluted
Duplication of Test
intent & implementation
Intent becomes
Imperative
Maintenance challenges
Scaling challenges
25. IDEAL TEST AUTOMATION PYRAMID
Manual / Exploratory
UI
Web Service
View
JavaScript
Integration
Unit
Time
Value
Cost
Business-facing
Tests
Technology-facing
Tests
28. ADVANTAGES
Validate what is
important - Business
requirements
Test Pyramid remains
sane
Abstraction layers allow
separation-of-concerns
Changes are isolated
Maintenance & Scaling
becomes ‘easier’
Advantages of
Business-Layer
Page-Object Pattern
29. TEST AUTOMATION FRAMEWORK BEST PRACTICES
Assertions & Validations
In Business Layer
Model
Test Data
Identify intent in
business terminology
Proper abstraction layers
Pages as
Dummy objects
Build Tools & Utilities
Evolve
Programming
practices
Design Patterns OOPs
30. REFERENCES
Page Objects – Google
https://code.google.com/p/selenium/wiki/PageObjects
Page Objects – Martin Fowler
http://martinfowler.com/bliki/PageObject.html
Test Design Consideration
http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp