Building automation framework is critical part of automation that is bypassed generally. Also writing a automation framework is an acquired skill. Why to build framework and how is the topic of talk.
Automation framework development can be considered same as to application development. The framework would greatly improve if the the same design principles used to write application code are leveraged to build it. By leveraging the 4 pillars of Object Oriented Programming in writing your automation framework, we can achieve the same level of efficiency as your application.
Here are a few quick examples:
Abstraction - use of different browsers to enable the test case to be run on many different system configurations.
Encapsulation - use of page objects as a class. Inheritance - keep common functionality in parent Page class and extend it for all other child Page classes.
Polymorphism - ability to change behavior at runtime Software development is built on the foundation of reusability and reliability. By making the steps in scenarios reusable and scenarios or test cases independent, we can lower the test maintenance costs and improve stability.