Types of Test Automation Frameworks:
Earlier in this Selenium Tutorial series, we have seen basic concepts of Selenium. In this post, we will learn Types of Selenium Automation Framework (Test Automation Frameworks) – Data-Driven, Keyword Driven, and Hybrid Framework. This will help you to clear your Selenium Interview.
Before discussing the types of test automation frameworks, let’s see what is a framework.
What is a framework?
A framework defines a set of rules or best practices that we can follow in a systematic way to achieve the desired results. So the above-mentioned test automation frameworks deal with best practices to achieve the goals of our automation project.
What is Selenium Framework?
Selenium framework’s code structure helps you to reuse the code, reduce code maintenance, higher code readability, and allows multiple users to work on the same piece of the program.
Why do we need the Selenium Framework?
- Easy code maintenance
- Increase in code re-usage
- Higher code readability
- Reduced script maintenance cost
- Reduced tests’ time execution
- Reduced human resources
- Easy reporting
Types of Selenium Automation Frameworks
Here in this post, I will explain the most popular Test Automation Frameworks.
- 1. Linear Scripting Framework
- 2. Modular Testing Framework
- 3. Data-driven Framework
- 4. Keyword Driven Testing Framework
- 5. Hybrid Driven Testing Framework
- 6. Behavior Driven Development Testing Framework
Check the below video to watch “Types of Automation Frameworks In Selenium / Types of Automation Frameworks in QTP/UFT”
Please be patient. The video will load in some time.
Linear Scripting Framework:
Linear Scripting Framework is a basic level test automation framework that is in the form of ‘Record and Playback’ in a linear fashion. This framework is also known as the ‘Record and Playback’ framework. This type of framework is used to test small-sized applications. In this type, creation, and execution of test script are done individually for each test case individually.
Using this framework, we could generate test scripts (Record and playback) without planning much or consume much time but it has its own drawbacks such as lack of reusability and hard coding the data does not allow us to run with multiple data sets.
Modular Testing Framework:
In the modular testing framework, testers create test scripts on module wise by breaking down the complete application under test into smaller, independent tests. In simple words, testers divide the application into multiple modules and create test scripts individually. These individual test scripts can be combined to make larger test scripts by using a master script to achieve the required scenarios. This master script is used to invoke the individual modules to run end to end test scenarios. In this framework, testers write function libraries to use it whenever required. This is AKA modularity framework or module-based framework.
Data-driven test automation framework is focused on separating the test scripts logic and the test data from each other. It allows us to create test automation scripts by passing different sets of test data. The test data set is kept in the external files or resources such as MS Excel Sheets, MS Access Tables, SQL Database, XML 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 module-based framework.
This framework 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 and reliable in terms of no impact on tests by changing the test data but it has its own drawbacks such as testers who work on this framework needs to have the hands-on programming knowledge to develop test scripts
Keyword Driven Testing 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. By using this Framework, testers can work with keywords to develop any test automation script, testers with less programming knowledge would also be able to work on the test scripts. 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.
Hybrid Driven Testing Framework:
Hybrid Test automation framework is the combination of two or more frameworks mentioned above. It attempts to leverage the strengths and benefits of other frameworks for the particular test environment it manages. Most of the teams are building this hybrid driven framework in the current market.
Behavior Driven Development Testing Framework:
The purpose of this Behavior Driven Development framework is to create 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 doesn’t require the users to be acquainted with a programming language. We use non-technical, natural language to create test specifications. Some of the tools available in the market for Behavior Driven Development is JBehave, Cucumber, etc.,
The frameworks stated above are some of the most popular Test Automation Frameworks used by the automation testers.
- Even though we have seen different types of test automation frameworks. Popular test automation frameworks out of all are Data driven framework, Keyword driven framework, and Hybrid framework.
- In the Data-Driven Framework, we keep test data in excel sheets & use TestNG’s data provider to execute test cases.
- In Keyword driven framework, we define keywords in the excel sheet and the code will call this file to execute the test cases
- The hybrid framework is a combination of both Data-driven and Keyword driven frameworks.
- Selenium Architecture
- Why WebDriver driver = new FirefoxDriver();
- How Much Java Is Required To learn Selenium
- How To Explain Automation Framework In An Interview
- Selenium Interview Questions
- TestNG Interview Questions