Webdriver automation with SOLID principles

28 Oct


Like in anything we do there is the way you are currently doing it and there are people doing it in a way that makes sense, it makes so much sense that once you hear about it, you will do it that way too.

A principle is a law or rule that has to be, or usually is to be followed, or can be desirably followed, or is an inevitable consequence of something, such as the laws observed in nature or the way that a system is constructed.

Schools have principles, nurses have principles too, so it’s not even a new idea

This is the same for baking a cake, painting or Webdriver automation.

Nothing is ever as easy as it looks…


Baking can often be referred to as the chemistry of cooking. All ingredients must be accurately measured, and measurement is critical.


Back to SOLID principles, Wikipedia says:

In computer programming, SOLID (single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the “first five principles” named by Robert C. Martin in the early 2000s that stands for five basic principles of object-oriented programming and design.

The intention is that these principles, when applied together, will make it more likely that a programmer will create a system that is easy to maintain and extend over time.

The principles of SOLID are guidelines that can be applied while working on software to remove code smells by providing a framework through which the programmer may refractor the software’s source code until it is both legible and extensible. It is part of an overall strategy of agile and Adaptive Software Development.


One of the biggest struggles that developers have is the integration their code into the live environment. As part of this continuous integration process automation also needs to be planned, designed, developed, maintained and extended over time.

When SOLID principles are not applied, your automation scripts might become fragile, hard to maintain and extend at some point.

What Are The SOLID Principles?

SOLID stands for:

  • S – Single Responsibility Principle (SRP)
  • O – Open Closed Principle (OCP)
  • L – Liskov Substitution Principle (LSP)
  • I – Interface Segregation Principle (ISP)
  • D – Dependency Inversion Principle (DIP)

I found a video that explains SOLID with some good examples


I found another video series that explains SOLID principles in more detail.

Automation testing is now seen as an important role in the Continuous Integration software life cycle process, so it makes sense to have SOLID guiding principles were testers can become more efficient with their testing.

One Response to “Webdriver automation with SOLID principles”

  1. Daria Johnson March 31, 2017 at 3:24 pm #

    Thank you for the video in your post! Everything is quite clear!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: