Advanced Concept of Selenium – Design Patterns in Selenium WebDriver – There is Not Only Page Object Model Design Pattern

Hello Folks,

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?”.

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.
#ThanksForReading
#HappySelenium

3 thoughts on “Advanced Concept of Selenium – Design Patterns in Selenium WebDriver – There is Not Only Page Object Model Design Pattern”

Leave a Reply

Your email address will not be published. Required fields are marked *