When we talk about design pattern in Selenium WebDriver, we generally discuss about Page Object Model (POM) and Behavioural Driven Development (BDD). But there are many more.
Before we go and see other design patterns in Selenium, I would like to explain “What is actually mean by Design Pattern?”.
A design pattern is a reusable solution for commonly occurring problems. It is a pattern or template that can be used to solve common problems. Design patterns are best practices which are used by software engineers to develop an application. Design patterns speed up development of application, tests and increases quality.
When we talk about design pattern in context of Automated tests, it actually represents how we design our automated tests. Like in Page Object Model, we separate test logics and supporting objects (Web elements generally). In BDD, we create methods for each step and include all desired actions. Of course we mix up design patterns as well. You should note here that design pattern does not mean how you manage your locators only. It talks about how well you manage your tests.
As per Selenium Wiki page, there are more design patterns in Selenium:
- DomainDrivenDesign: Express your tests in the language of the end-user of the app.
- PageObjects: A simple abstraction of the UI of your web app.
- LoadableComponent: Modeling PageObjects as components.
- BotStyleTests: Using a command-based approach to automating tests, rather than the object-based approach that PageObjects encourage
- AcceptanceTests: Use coarse-grained UI tests to help structure development work.
- RegressionTests: Collect the actions of multiple AcceptanceTests into one place for ease of maintenance.
I will post more on different design patterns in upcoming posts.
If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
Author: Amod Mahajan
My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning