Elements of a Good Test Automation Framework

Introduction 

Over a period of time, all testing communities have realized the benefits of implementing test automation framework. Test automation framework plays a vital role in the success or failure of any software automation project. Before starting any testing, it is highly recommended by software quality experts to create a test automation framework, which not only supports the entire software testing process, but also helps improve the quality of software testing process.

Here is a brief summary of basic elements for creating any automation framework:

Basic Setup

The user (tester) should familiarize themselves with application to be tested by doing some exploratory testing and conclude what the requirements are and how automation framework would test it. Consider about creating separate config files to run in more than environment. The user should choose the data wisely so that it matches with production data. They should see if objects are created that can be shared among scripts.

Framework Design

This is the core part where various tests are added /executed. Users should consider Oops concepts to handle various actions and have shared utilities for common actions. While creating/handling data objects, make sure that chaining mechanism is there i.e. Input object should be able to accept data objects from previous steps.

Verification

For every test (action), there should be a verification independent of other tests. This element should be designed in such a way that if some data processing is going on it should wait or trigger after a fixed duration of time to verify the data.

Logging and Reporting

Logging should be designed in such way indicate what user is verifying and what is the expected results.Non-technical users should also be able to read logs and find root cause of the failures. These logs should be kept at common place and results should be reported via e-mail.

Other than this, here are few more good practices that experts suggest for designing a reliable automation framework

  • Handle data and scripts separately
  • Create libraries so that design is flexible
  • Automation framework should be portable
  • Use soft assertions while doing verification
  • Use SOLID principle
  • Automate Reporting
  • In reporting , take screen shots of failures(mainly crashes)
  • For UI Applications, use Page Object Model