Page Object Model (POM)
When? Testing web applications. Why? It abstracts the web pages and their elements into separate classes and separate test logic, making the test code more readable and maintainable.
Facade Pattern and Chain of Invocation
When?
- Complex test framework
- Multiple tools and libraries
- Legacy systems Why?
- Simplifies test case development
- Enhance maintainability
- Improve reusability
Factory Pattern
What? A creational design pattern that provides an interface for creating objects in a super factory method but allows subclasses to alter the type of objects that will be created
Why? Abstraction and Extensibility.
When:
- Browser factory
- Page object factory
- Test data factory
- Custom object creation
BDD (Behaviour-Driven development)
What? The requirements of a system and tests are expressed and designed in a way that is accessible to both technical and non-technical team members using Gherkin language syntax.
Why?
- Collaboration among team
- Requirements Clarification
- Test Automation with Clarity
- Living Documentation
KDT (Keyword-Driven testing)
What? Separates the test design and execution phases
Why? Separation / Non-Technical Testers / High-Level Test Design / Cross-Platform
Test Automation Design Patterns
DDT (Data-Driven testing)
What? Test cases are executed multiple times with different sets of input data
When?
- Variation in test scenarios
- Cross-Browser and Cross-Platform testing
- Load and Performance testing
- Boundary testing
- Localization Testing
- Increase test coverage
Test Automation Design Patterns
Fluent Pattern
What? A method chaining technique used to create more readable and expressive code by allowing calls to methods to be chained together
Why?
- Improve Readability
- Simplifying Test Steps
- Method Chaining for Assertions
- Custom Builder
Singleton Pattern
What? A creational design pattern that ensures a class has only one instance and provides a global point of access to that instance.
Why?
- Resource Management
- Global Access (Single instance)
- Consistency of Behavior
- Reduced overhead of repeatedly creating resource instances
Decorator Pattern
What? A structural design pattern that allows you to add new behaviors or functionalities to objects dynamically without altering their existing structure
Why? Open for Extension, Closed for Modification ( a Clean code principle) / Reusable Components / Separation of Concerns by isolating additional functionalities in decorator classes / Customization
Wrapper (Adapter) Pattern
What? A design pattern used to enable the interaction between two incompatible interfaces or classes.
When?
- Interacting with External APIs
- Browser Automation
- Database Interactions
- Custom Test Utilities
- Third-Party Components

