Previous Topic, Test automation Framework provides set of rules for handling data, maintaining object repository and executing test scripts in a proper formal structure. In this tutorial we will learn types of Testing Automation Framework in details.
The guidelines when followed gives a long term benefit like Code-Re usability, easy maintenance, improved test efficiency and maximum test coverage.
Note: These rules are not mandatory but on skipping the defined and well structured framework, benefits also get lost.
Types of Testing Automation Framework
There are basically 4 types of Testing Automation Framework that differs from one another from their architectural point of view with their advantages and disadvantage. So its very important to choose a framework wisely as per the requirement, these frameworks are as below.
- Linear Framework
- Modular Testing Framework
- Data Driven Framework
- Keyword Framework
- Hybrid Framework
- Behaviour Driven Development Framework
Lets consider their details:
1) Linear Framework: It is basic level test automation framework which is in the form of ‘Record and Playback’ in a linear fashion. Tester manually executes the application and the tools record the steps of manual execution, capturing it attributes along the value with its test data(manually filled). Once the record is done and terminated by the tester, the recorded script can be executed & is used for testing.
When to use Linear Framework?
Answer→ Linear Framework is used when we need to test a complete flow with single test data(Parameterization of test data not required). As it requires no coding skill sets with no customised records(ex : logs, report, integration with other tool).
Advantages of Liner Framework:
- Easy to create script
- No coding skills are required
- Easy to learn(as its have restricted features)
Disadvantages of Linear Framework:
- No reusable functions
- Not easy to maintain
- Cannot execute the scripts with multiple sets of data.
Note: Linear framework is out from market now, its never used further as a part of framework.
2) Modular Testing Framework: In this framework, the application under test(AUT) is divided in to multiple modules and each module are further divided in to small scripts which are independent to each other. These individual test scripts are combined to create a large script which further fulfill the requirement of execution on defined scenario.
Advantages of Liner Framework:
- If any change comes to an application only a particular module is being changed
- Scalable
- Easy maintenance of code due to modular structure
Disadvantages of Linear Framework:
- Due to embedded test data in test script, creates problem while updating the code
3) Data Driven Framework:In this framework ,the test data and test logic are placed in different file. The test data is usually kept external from the script in the form of CSV, Excel, ODBC etc. Functions/methods are made generic & data is passed in the form of parameter to the method body.
Here scripts are executed with different sets of data provided on external test data sheet unlike in linear programming where we are bounded to use hard coded data defined in script
When to use Data Driven Framework?
Answer→ Data Driven framework comes in to picture when we want our scripts to run them on large sets of data with different combinations.
Advantages of Data Driven Framework:
- Same scenario can be tested with different set of data
- Structured framework easy to understand
Disadvantages of Data Driven Framework:
- Tester has to create different files for keeping the test data and test logic
- Time consuming
4) Keyword Driven Framework: In this Framework, keywords are been created for the different generic actions to be performed in GUI, these keywords are kept at external file and not under the test logic. Under this framework the keyword, object repository and functions are associated to work properly.
The external sheet contains keyword along with test data and object details. Whenever any keyword is been called, it executes its process(created function), identify its object and provide data in the Test Data column
When to use Keyword Driven Framework?
Answer→ Keyword framework is a preferred when we have limited type of objects in our application & our test script consist of repeative action on those objects. Example in case of Siebel CRM application, we have limited type of control available.
Here we can create our own standard library of common components and extend reusability. Also by following this framework we can can hide our scripts from user and write our script in abstract manner
Advantages of Keyword Driven Framework:
- Code reusability
- Test designing can be done without AUT (application under test)
- Save time for multiple test design
Disadvantages of Keyword Driven Framework:
- Shilled tester is required with programming skills
- initial Cost of scripting is high
- Need to maintain multiple sheets for test creation.
5) Hybrid Framework: This framework is a combination of one or more framework. As per the requirement we customise the framework & use the strength associated with different type of frameworks. Most commonly hybrid framework is the combination of Keyword and Hybrid approach.
Here we can use data from different channels (xml, csv, database, etc) with process defined in a form of keywords. This helps a tester to easily create, maintain and execute the automation scripts which can be re used in longer run
When to use Hybrid Framework?
Answer→ Whenever we come with a requirement to parameterise the test case with multiple sets of test data and have lot of repetitive steps called in every or most of the test cases, along with frequent execution, Hybrid framework comes in to picture. This type of framework has almost captured the market and in use mostly used.
6) Behaviour Driven Development Framework: This framework helps in active participation of (Business Analyst, Developer, Tester). It does not require user to be highly skilled programmer, user just need natural language to create test scripts. There are few tools available in market like cucumber, jBehave , etc.
Advantages of Data Driven Framework:
- Easy to create test script.
- No need to have programming skills.
Disadvantages of Data Driven Framework:
- Need to have understanding of BDD structure and syntax.