19. ADVANTAGES OF
BUSINESS-LAYER PAGE-OBJECT PATTERN
¨ Validate what is important - Business requirements
¨ Test Pyramid remains sane
¨ Abstraction layers allow separation-of-concerns
¨ Changes are isolated
¨ Maintenance & Scaling becomes ‘easier’
21. Why do we need to
think differently
about Test Data?
22. CRITERIA FOR TEST DATA
¨ Data is complex
¨ Needs to mimic “real” data
¨ Though specified as static, may need to be Dynamic
¨ Data can be shared and reused
¨ Data needs to be unique
¨ Data can be nested
22
23. DIFFERENT WAYS TO SPECIFY TEST DATA
¨ In Test implementation
¨ In Test specification / intent
¨ In code … separate data structures / classes / etc.
¨ External files
23
24. TEST DATA SPECIFICATION EXAMPLES
¨ Excel
¨ CSV
¨ Property
¨ XML
¨ YAML
¨ Database
¨ Json
24
26. CRITERIA FOR SELECTION
¨ Easy to specify
¨ Easy to read and consume (by test framework)
¨ Ability to override specified data, easily
¨ Usable
26
27. TIPS FOR IMPLEMENTATION
¨ Consistent way to specify test data
¨ Read the data – as Business Entities
¨ Override as appropriate
¨ Create DSL to give meaning to data
¨ Use in test implementation
¨ Implement Test Data Entity Utilities – Build, Equals, Copy,
Find, etc.
27
34. PRINCIPLES FOR A TEST AUTOMATION FRAMEWORK
Code quality
Design
Patterns
Abstraction Layers
Refactor, Evolve
& Extend
Pairing
35. PRACTICES FOR A TEST AUTOMATION FRAMEWORK
Configurable
No Copy-Paste
Continuous Integration (CI)
Test Data
Tools & Utilities
- Logging
- Screenshots
- Video
36. TEST AUTOMATION FRAMEWORK BEST PRACTICES
Assertions & Validations
In Business Layer
Model
Test Data
Proper abstraction layers
Pages as
Dummy objects
Evolve
Programming
practices
OOPsDesign Patterns
Identify intent in
business terminology
Build Tools & Utilities
37. REFERENCES
Page Objects – Google
https://code.google.com/p/selenium/wiki/PageObjects
Page Objects – Martin Fowler
http://martinfowler.com/bliki/PageObject.html
Perils of Page-Object Pattern – Anand Bagmar
http://essenceoftesting.blogspot.in/2014/09/perils-of-page-object-pattern.html
Test Design Consideration
http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp