Skip to content
Use the power of design patterns to solve different software automation related problems - Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Use the power of design patterns to solve different software automation related problems - Python

List of design patterns covered for automation testing

Page object pattern


  • Hide bad APIs behind better ones
  • Automation related: represent each page (including elements and action over them) of an application as an object


  • Targeted app:
  • Implement base page:
    • Currently supported:
      • open/quit the browser
      • wait for elements to be visible
    • Feature methods:
      • generic validator
      • different clicks
  • Each new page created will extend the base class
  • Implement a search for a video as example:
    • enter a string to query e.g. Python
    • click on search button
    • filter result list based on a keyword e.g. Python
    • select the video found based on this query
  • In tests section, under page_object_pattern package, two tests are performed:
    • a simple one to perform the wait for element action from base class
    • a search flow
    • note that from now on the test implementation is hidden in a specific page;
    • to perform some tests, you just have to call different page specific methods



  • Creational design pattern.
  • Provides an easy way to create a single instance of an object.


  • Access the same instance of the driver session class.
  1. The entire definition of the object class is encapsulated in the builder class:

    • The outer class exposes a method that returns the instance of the inner class.
  2. Design a class that handles the instantiation.

    • Inject the definition of the desired class in the singleton factory and the factory is responsible for returning the same instance.

Factory pattern

Simple factory

Abstract factory


  • Paul Bodean
  • Eugen Meltis


This project is licensed under the MIT License - see the LICENSE file for details

You can’t perform that action at this time.