An introduction to Test Automation Frameworks

What is an Automation Framework and why is it needed?

Automation testing has been widely accepted for delivering faster and quality products. Test automation, as you know can be defined as a process of performing software testing activities utilizing the various testing tools available. The number of choices you have for automation testing tools is innumerable nowadays including commercial tools like well as open source tools. Each tool has its own features and benefits and you would have to choose wisely the tool you need for your application. Be it any tool you chose, before initiating the process of test automation, experts strongly recommend to have a test automation framework which should be the basis for your entire automation process.
Now, what is this test automation framework all about? Well, the word framework usually corresponds to an essential supporting structure of any object or system. Test automation framework too refers to a conceptual structure on which your test automation scripts can be built to effectively perform automated software testing. It is not mandatory to have a test automation framework to write automation scripts. You could very well go ahead without the framework. You could relate it to a set of rules or guidelines or agenda you have for a meeting. You can very well conduct a meeting without any guideline. But, the guidelines could really help in having the meeting smoothly covering all the essential points. If done without the guidelines, it could go in a random way creating distraction or without covering all points and end up without much benefits. Same is the case with test automation framework. It provides guidance to your automation process and supports as well as improves the quality of the entire software testing process.
To put it simply, automation framework consists of a set of guidelines on coding standards, handling test data, treatment of libraries and object repositories, etc. These guidelines ensure benefits like increased code re-usage, higher portability, lesser and easy maintenance of scripts, etc. Although the setting up a framework increases the investment cost, organizations and clients now understand the importance of having an automation framework and consider it to be an essential part for successful automated testing process providing high Return on Investment (ROI). Given below are some of the points usually covered in an automation framework:

  • Coordinating the different test tools to work together.
  • Create libraries which can be re used for different projects and thus minimize development efforts due to duplication of work.
  • Follow strict coding standards so that the entire group of people involved follows the same guidelines and discourage individual coding practices to maintain code uniformity across the projects.
  • Allow for easy maintenance and extensibility accommodating new enhancements to the application and allow modification of scripts easily.
  • Overall coordination of the automation process to improve the test efficiency.

Types of Automation Frameworks

There are different types of automation frameworks available, each having different features and architecture. The type of framework you choose should be done based on the requirement and nature of your application. Here is a quick overview of the different types of automation frameworks.

1.Linear Automation Framework

This is the simplest framework which requires least expertise in designing the framework. It simply refers to the record and playback of scripts where the testers need not write any code and the steps are just recorded sequentially, and check points inserted wherever necessary. To run the test, the scripts are just played back. This is the fastest way to generate scripts, but comes with limitations like less re usability of scripts and difficulty to maintain the scripts in case of any modifications to the application.

2. Modular Framework

In this type of framework, the entire application conceptualized as different modules and scripts are written for each module separately. To create test cases, the different modules can be combined to do the required steps. Splitting the entire application into different modules enable modifications to associated individual modules in case of modifications to any part of the application. It also allows re using the modules for different scripts.

3. Library Architecture Framework

This framework is almost similar to the modular framework. The difference is that, in modular framework, the application is split based on different modules in the application while in Library architecture separate scripts are created for different tasks to be performed or objectives in the application. For example for a ticket reservation application, the different objectives may be Book a ticket, Cancel a ticket, Review your booking history, etc. This type of framework too offers benefits like script re usability and easy test maintenance.

4. Data driven framework

In this type of framework, the test data is separated from the script logic. This implies the test data may be stored externally in an excel file, text file, csv file, sql table or ODBC repositories instead of it being hard coded in the scripts. This allows you to test with multiple data sets and also update the data source whenever you need to make change to the data to be tested.

5. Keyword Driven framework

In Keyword driven framework, each function is represented in a table as step by step instructions for performing each test. In Keyword driven framework, the data and script logic are separated as in data driven framework. Keyword driven framework goes a step further by keeping the set of code belonging to the test script also into an external file. Due to this separation of coding from test cases so that even non technical person can understand the steps. Keyword driven framework uses data files containing keywords related to the application under test. The keywords describe the actions to be performed in a step. The keywords are then associated to an action or function related to the keyword. It is also known as Table driven or action word based framework as the keywords and test data are stored in tabular structures. Keyword driven framework too offers great code re usability and maintainability.

The initial cost of setting up keyword driven framework is often considered to be high. But once implemented, it gives you manifold benefits.

6. Hybrid Framework

Based on your automation needs, most of the time you would have to use a combination of two or more of the above frameworks so that you can enjoy benefits of different frameworks. Such frameworks are called hybrid frameworks.

That’s all on the basics of automation frameworks. Identifying the right type of framework for your project is very important and hybrid frameworks may be usually needed in real time projects for successful automation. The ultimate aim of a framework is to make your automation code most reusable, maintainable and stable. Hope the article helped throw some light on what is an automation framework and the different types of frameworks available!