Automation Frameworks
1. What is Test Automation Framework?
Suppose you are given a task where you have to automate some test cases for an application. When you are finished automating the application, what would be your expectations from the scripts you have created? Wouldn’t you want that –
the scripts should run as intended without any issues.
the code and the flows should be easy to understand.
the scripts should be easy to maintain in case of any changes.
All the above points can be achieved by using a proper Automation Framework.
An Automation Framework is a set of guidelines that you can follow during test case scripting to achieve the above mentioned results. This set of guidelines can be anything such as –
Specifying the folder structure that will be used for storing test cases, function libraries, object repositories and data sheets.
Deciding the format of the data sheets i.e., how the data sheets would be grouped and how the scripts will access these data sheets.
Following proper coding standards and using comments so that the code can be understood easily by anyone.
Using reusable functions wherever possible so that lesser amount of rework is needed in case of any changes
Following the guidelines (that you have set) consistently during the creation of the test scripts would result in the creation of an end product(your Automation Framework) that include all the features which you had targeted for.
Types of Frameworks
1.Keyword framework
2.Datadriven framework
3.Modular framework
4.Hybrid framework.
1.Keyword framework
In Keyword Driven framework, you can create various keywords and associate a different action or function with each of these keywords. Then you create a Function Library that contains the logic to read the keywords and call the associated action.
Advantages of Keyword Driven Framework
The keyword and function libraries are completely generic and thus can be reused easily for different applications.
All the complexity is added in the function libraries. Once the libraries are ready, it becomes very easy to write the actual test script steps in excel sheets.
Disadvantages of Keyword Driven Framework
Lot of time and effort needs to be spent initially to create the function libraries. The benefits of the keyword driven framework are realized only after it has been used for longer periods of time.
Very high programming skills are needed to create the complex keyword library functions.
It’s not easy for new people to understand the framework quickly.
2.Datadriven framework
In Data Driven Framework, the data is NOT hard-coded in the test scripts. Instead, it is stored in some external files. The test script first connects to the external data source and then extracts the data from that source. Most of the times, excel sheets are used to store the data. Other external data sources that are frequently used are –
Text files.
XML files.
Databases.
Combination of more than one external file.
Advantages of Data Driven Framework
Since the data is kept separate from the test script, the same script can be run multiple times for different sets of data (which can be kept in multiple rows in the data sheet).
Changes made in the test data don’t affect the test scripts in any way and vice versa.
Disadvantages of Data Driven Framework
Additional effort and good technical expertise is required to create functions that connect to the external data sources to retrieve the data.
Additional amount of time is required in identifying which external data source to use and deciding how the data should be stored or grouped in that external data source.
3.Modular framework
Modular Framework is the approach where all the test cases are first analyzed to find out the reusable flows. Then while scripting, all these reusable flows are created as functions and stored in external files and called in the test scripts wherever required.
Advantages of Modular Framework
Test Scripts can be created in relatively less time as the reusable functions need to be created only once.
Effort required to create test cases is also lesser due to code reuse.
If there are any changes in the reusable functions, the changes need to be done in only a single place. Hence script maintenance is easier.
Disadvantages of Modular Framework
Since data is still hardcoded in the script, the same test case cannot be run for multiple data values without changing data after each run.
Additional time is spent in analyzing the test cases to identify with reusable flows.
Good programming knowledge is required to create and maintain function libraries.
4.Hybrid framework.
Hybrid Framework is a framework that is created by combining different features of any of the frameworks mentioned above. Based upon your requirements, you can combine the features of any of the above frameworks to come up with your own version of Hybrid Framework.
Advantages of Hybrid Framework
The main advantage of this approach is that you can use the best features from all the types of frameworks to create your own.
Disadvantages of Hybrid Framework
The framework is highly complex and needs very good programming expertise and experience to build a Hybrid Framework from scratch.
Suppose you are given a task where you have to automate some test cases for an application. When you are finished automating the application, what would be your expectations from the scripts you have created? Wouldn’t you want that –
the scripts should run as intended without any issues.
the code and the flows should be easy to understand.
the scripts should be easy to maintain in case of any changes.
All the above points can be achieved by using a proper Automation Framework.
An Automation Framework is a set of guidelines that you can follow during test case scripting to achieve the above mentioned results. This set of guidelines can be anything such as –
Specifying the folder structure that will be used for storing test cases, function libraries, object repositories and data sheets.
Deciding the format of the data sheets i.e., how the data sheets would be grouped and how the scripts will access these data sheets.
Following proper coding standards and using comments so that the code can be understood easily by anyone.
Using reusable functions wherever possible so that lesser amount of rework is needed in case of any changes
Following the guidelines (that you have set) consistently during the creation of the test scripts would result in the creation of an end product(your Automation Framework) that include all the features which you had targeted for.
Types of Frameworks
1.Keyword framework
2.Datadriven framework
3.Modular framework
4.Hybrid framework.
1.Keyword framework
In Keyword Driven framework, you can create various keywords and associate a different action or function with each of these keywords. Then you create a Function Library that contains the logic to read the keywords and call the associated action.
Advantages of Keyword Driven Framework
The keyword and function libraries are completely generic and thus can be reused easily for different applications.
All the complexity is added in the function libraries. Once the libraries are ready, it becomes very easy to write the actual test script steps in excel sheets.
Disadvantages of Keyword Driven Framework
Lot of time and effort needs to be spent initially to create the function libraries. The benefits of the keyword driven framework are realized only after it has been used for longer periods of time.
Very high programming skills are needed to create the complex keyword library functions.
It’s not easy for new people to understand the framework quickly.
2.Datadriven framework
In Data Driven Framework, the data is NOT hard-coded in the test scripts. Instead, it is stored in some external files. The test script first connects to the external data source and then extracts the data from that source. Most of the times, excel sheets are used to store the data. Other external data sources that are frequently used are –
Text files.
XML files.
Databases.
Combination of more than one external file.
Advantages of Data Driven Framework
Since the data is kept separate from the test script, the same script can be run multiple times for different sets of data (which can be kept in multiple rows in the data sheet).
Changes made in the test data don’t affect the test scripts in any way and vice versa.
Disadvantages of Data Driven Framework
Additional effort and good technical expertise is required to create functions that connect to the external data sources to retrieve the data.
Additional amount of time is required in identifying which external data source to use and deciding how the data should be stored or grouped in that external data source.
3.Modular framework
Modular Framework is the approach where all the test cases are first analyzed to find out the reusable flows. Then while scripting, all these reusable flows are created as functions and stored in external files and called in the test scripts wherever required.
Advantages of Modular Framework
Test Scripts can be created in relatively less time as the reusable functions need to be created only once.
Effort required to create test cases is also lesser due to code reuse.
If there are any changes in the reusable functions, the changes need to be done in only a single place. Hence script maintenance is easier.
Disadvantages of Modular Framework
Since data is still hardcoded in the script, the same test case cannot be run for multiple data values without changing data after each run.
Additional time is spent in analyzing the test cases to identify with reusable flows.
Good programming knowledge is required to create and maintain function libraries.
4.Hybrid framework.
Hybrid Framework is a framework that is created by combining different features of any of the frameworks mentioned above. Based upon your requirements, you can combine the features of any of the above frameworks to come up with your own version of Hybrid Framework.
Advantages of Hybrid Framework
The main advantage of this approach is that you can use the best features from all the types of frameworks to create your own.
Disadvantages of Hybrid Framework
The framework is highly complex and needs very good programming expertise and experience to build a Hybrid Framework from scratch.
No comments:
Post a Comment