What is a Test Automation Framework?
A framework defines a set of rules or best practices that we can follow in a systematic way to achieve the desired results. In terms of test automation, a Test Automation Framework is a set of guidelines like coding standards, test-data handling, object repository treatment etc. which when followed during automation scripting provides benefits like low script maintenance cost, high code re-usability, higher portability, reliability and efficiency. These are just guidelines and are not mandatory ,one can still script without following the guidelines but will miss out on the advantages of having a framework in place.
Example scenario -
The teacher has told her students that she will be taking a Math test on addition and substraction on Monday. She gave some guidelines that students can prepare from the test by solving the problems in study guide notebook on addition and substraction.Students should use pencil ,eraser and blank paper to do any scratch work during their exam day. Students should not talk or distract other students during the exam. Students can connect with her if they have questions/doubts on the study guide problems.
Now, it is not mandatory to strictly follow these guidelines. Some students who follow them would surely benefit and can get good scores because of the preparation and guidelines, but some few students may not follow all these guideline or use the study guide. The outcome may not be necessarily failure but there could be high chances of uncertainty or low score.
Similarly, this Test Automation Framework although not mandatory allows one to follow the standards and best industry practices to reap in the benefits of various frameworks to achieve the desired results or outcomes.
Now Let's take a look at the different types of Test Automation Frameworks.
Types of Test Automation Frameworks
1. Linear Automation Framework.
A linear automation test framework is the simplest introductory level testing. It is also know as “Record & Playback”. In this framework, Testers sequentially create test scripts(Record the steps) and individually run them in the first round. He then , Plays back the recorded script in the subsequent rounds (Playback).
There is no need to write custom code. So testers don’t have to be automation experts. It’s a one-at-a-time to the point testing approach. Pick one functionality, write a script, and test. Also, a speedy workflow is the biggest perk of linear automation framework.
2. Modular Based Testing Framework.
Modular-based test frameworks break down test cases into small modules. Thereafter it follows a non-incremental and incremental approach. There, the modules are independently tested first and then the application is tested as a whole making each test independent. Moreover, once a tester is done writing a function library, you can also store a script in it. Since you can easily make changes in a single script, adjusting the entire application is not necessary. This process thus reduces the testing time and efforts.
3. Library Architecture Testing Framework.
Library Architecture Testing Framework is also know as “Structured Scripting” or “Functional Decomposition”. In this framework ,test scripts are initially recorded by “Record & Playback” method. Later, common tasks inside the scripts are identified and grouped into Functions. These Functions are stored in the library stores and are then called by main test script called Driver in different ways to create test cases.
This framework is useful when the application has similar functionalities across different parts of the application as it facilitates re usability of code across different test scripts.
4. Data-Driven Framework.
A data-driven test framework separates the test script logic from the test data. The separated test data set is kept in the external files or resources such as MS Excel Sheets, MS Access Tables, SQL database, XML files, CSV Files etc. The test scripts connect to the external resources to get the test data. By using this framework we could easily make the test scripts work properly for different sets of test data. This framework significantly reduces the number of test scripts compared to the module-based framework and gives more test coverage with reusable tests and flexibility in the execution of tests only when required and by changing only the input test data.
5. Keyword-Driven Framework.
It is also known as table-driven testing or action word based testing. In Keyword-driven testing, we use a table format to define keywords or action words for each function or method that we would execute. It performs automation test scripts based on the keywords specified in the excel sheet. The logic to read keywords and call the required action mentioned in the external excel sheet is placed in the main class. Keyword-driven testing is similar to data-driven testing. Even though to work on this framework doesn’t require much programming skills but the initial setup ( implement the framework) requires more expertise.
6. Hybrid Testing Framework.
Hybrid Test automation framework is the combination of two or more test frameworks. The objective of using this framework is to leverage the strengths and benefits of other frameworks and mitigate the weaknesses of other frameworks. This improves the efficiency of testing .Most of the teams are building this hybrid driven framework in the current market and it keeps evolving over time.
7. Behavior Driven Development Testing Framework
Behavior Driven Development framework creates a platform that allows everyone (such as Business Analysts, Developers, Testers, etc) to participate actively. It requires increased collaboration between Development and Test Teams.It uses non-technical, natural language to create test specifications, hence programming language in not essential. Jbehave, Cucumber etc. are some of the tools available in the market for Behavior Driven Testing framework.
Conclusion
So, a good test automation framework is a must-have for any development team and it provides multiple as listed below.
It reduces the risk and cost expenses
It improves the efficiency of tests
It helps to reduce the maintenance cost
Allows the reuse of code
It allows achieving maximum test coverage
It maximizes the application functionality
Helps to reduce test case duplication
It helps to improve the test efficiency and performance with test automation
I hope this gave article gave you useful information on different types of Test Automation Frameworks. Please provide your valuable comments and feedback if you liked it.Thanks!!