This document discusses patterns for test automation frameworks. It begins by introducing common patterns like page objects, business layer, and factories. It then provides examples of page object and business layer page object patterns. The document also discusses test data patterns and different ways to specify test data and locators. Finally, it outlines advantages of using patterns like reduced complexity, reusability, and maintenance. The key message is that the best pattern depends on the specific test automation context.
4. TELL ME ...
¨ Any Managers in the room?
¨ Developers / Testers / Automation “folks” in the room?
¨ What toolset do you use for Automation?
¨ How many automated tests do you have?
¨ Have you heard the phrase - ”Test Automation code
should be of Production Quality”?
¨ Do you believe it?
¨ Anyone in the room does not code / understand code?
4
24. 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’
26. Why do we need to
think differently
about Test Data?
27. CRITERIA FOR TEST DATA
¨ Data is complex
¨ Needs to mimic “real” data
¨ Needs to be unique
¨ Data can be nested
¨ Though specified as static, may need to be Dynamic
¨ Data can be shared and reused
28. DIFFERENT WAYS TO SPECIFY TEST DATA
¨ In Test implementation
¨ In Test specification / intent
¨ In code … separate data structures / classes / etc.
¨ External files
31. CRITERIA FOR SELECTION
¨ Easy to specify
¨ Easy to read and consume (by test framework)
¨ Ability to override specified data, easily
¨ Usable
32. 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.
36. ADVANTAGES OF PATTERNS
¨ Well known, well understood
¨ Tried & tested solutions for common problems
¨ Reduces complexity
¨ Language neutral
¨ Aid in communication
37. ADVANTAGES OF PATTERNS IN TEST AUTOMATION
Saves time & effort
(eventually)
Single ownership
Test Automation Code is of Production Quality!
Single point of change
Easy to –
- Implement
- Maintain
- Debug
- Scale