Design Patterns in Test Automation




Page Object Pattern


  • PageObject Element Map 
    • Properties of all web elements of the page and their locators
  • Page Object
    • Actions of the page
  • Page Object Validator
    • Validations/Assertions on the page
  • Tests Class 
    • Group of tests referencing the page objects, it can hold only a single instance of the page object. 


Facade Design Pattern


  • Facade
    • Holds methods that combine actions executed on multiple pages
  • Page Objects (ItemPage)
    • Holds the actions that can be performed on the page like Search and Navigate. Exposes an easy access to the Page Validator though the Validate() method. 
  • PageObject Element Map 
    • Properties of all web elements of the page and their locators
  • Page Object Validator
    • Validations/Assertions on the page
  • Tests Class 
    • Group of tests referencing the facade, it can hold only a single instance of the facade.


Singleton Design Pattern


  • Page Objects (ItemPage)
    • Holds the actions that can be performed on the page like Search and Navigate. Exposes an easy access to the Page Validator though the Validate() method. 
  • PageObject Element Map 
    • Properties of all web elements of the page and their locators
  • BasePage
    • Gives access to the child’s page element map class and defines a standard navigation operation.
  • BasePage 
    • Adds an instance to the child page’s validator class through the Validate method.
  • BaseSingleton 
    • This is an abstract class that provides a static property of its child instance.



Fluent Page Object Design Pattern


  • Page Objects (ItemPage)
    • Holds the actions that can be performed on the page like Search and Navigate. Exposes an easy access to the Page Validator though the Validate() method. 
  • BasePage
    • Gives access to the child’s page element map class and defines a standard navigation operation.
  • BasePage 
    • Adds an instance to the child page’s validator class through the Validate method.
  • BaseSingleton 
    • This is an abstract class that provides a static property of its child instance.
  • BaseElementMap
    • Provides easier access to current browser and functions to switch between different frames.
  • BasePageValidator
    • Gives all child validators instance to the current element map and the page object itself.

Source:  https://dzone.com/articles/observer-design-pattern-design

Comments

  1. This is extremely great information for these blog!! And Very good work. It is very interesting to learn from to easy understood. Thank you for giving information. Please let us know and more information get post to link.

    Oracle Training in Chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

XPATH for IE / internet explorer

All time good software testing books!