The most popular Test Automation Framework and advantages and disadvantages of each type

Tram Ho

What is a framework?

Framework is a library of classes that have been built completely, the framework for developing Application Software. Frameworks can be compared to a set of “materials” in each field for programmers, instead of having to spend a lot of time to design themselves before using.

What is test automation framework?

The automated testing framework provides a specific architecture for our testing project, which the foundation of the testing tools we use often doesn’t. Each type of framework has its own rules, guidelines, protocols, and procedures for tasks such as creating test cases, organizing and executing test cases.

Below are the 6 most common frameworks for automated testing.

The order is arranged in ascending order according to the complexity and level of orientation in order to achieve the test objectives. And aspects used to evaluate that include scalability, reusability, maintenance efforts, and investment costs for technical-related skills such as knowledge transfer. , training the manpower or the effort required to learn new technologies …

1. Module Based Testing Framework

With this framework, we will build independent test scripts, corresponding to each module, the compoment or the functions of the application software. Avoiding the use of interdependent scripts is an important factor for the stability and maintainability of this framework.


Easy maintenance and cost savings.

If changes are implemented in a part of the application, only test scripts of that part of the application need to be fixed to keep all other parts unaffected.


When there is a change in the test data, the scripts must also change accordingly, or you must create a new separate test script to meet that change.

2. Library Architecture Testing Framework

This framework is basically based on the Module Based Framework but has some advantages.


Easy maintenance and cost savings.

Instead of dividing the application with the corresponding modules and test scripts, here we will separate test scripts of shared functions into a common library, and can be called whenever needed. , without having to do the same scipt over and over again. This helps keep code from being too long and redundant, and reduces the effort required to build the script.

Simple example you can imagine in using this framework as Login work on an application.

Usually the login step is the first step to take before performing the following functions. Therefore, instead of this login step having to be built before all the functions that need to be tested, we will build a Common Lib, containing this login step, so from now on we just need to call this function in Common to use Well, not just do it over and over in each script. This also helps us more leisurely in if this login step has some changes that need updating, now we only have to edit in one place rather than going everywhere to edit it again!


As with the Module Based Testing Framework, when there is a change in the test data, the scripts must change accordingly, or you must create a new separate test script to meet that change.

3. Data Driven Testing Framework

In automation or in the normal testing process, testing a function that must be repeated many times with different test data is something that we will have to encounter very often. Moreover, in some cases, it is not possible to embed test data into a test script. Therefore one must think about storing test data externally, separate from test scripts.

The data-driven approach in this case is clearly more efficient and easier to manage than the above two. Test data for scripts is transmitted from an external database, so the reuse of that script is also higher. These databases store data as xml, excel, text files, CSV, etc. These data are stored according to a common convention of ‘Key – Value’, these keys will be used to access. Access and transfer data to the corresponding test scripts through a number of common libraries.


This framework will significantly reduce the number of test scripts needed compared to the use of module-oriented framework.

Test data can be changed independently of test scripts, meaning that when you change the values ​​of test data, you only need to update the external data storage, not in each script to edit. fix anything.


This framework is more complex and it also requires users to have a certain programming skills in project setup and maintenance.

For example:

About the “Gmail – Login” function

Step 1 : First, create an external file that stores the test data (Input data and Expected Data).

Step 2: Put test data into Automation test Script.

The above method helps to read test data and the test below helps users to input test data on the GUI.

4. Keyword Driven Testing Framework

Keyword driven is an extension of the Data driven framework, also known as table-driven. For this approach, the test data is also separated from the test script, and in addition the keywork values ​​of the aciton are stored in the external database file. These key words are instructions for determining what actions will need to be performed to test the application.

Example: A test case under the keyword driven testing framework is as follows:

As the data table above, we have the keywork column with values ​​such as login, clickLink and verifyLink. Depending on the nature of the application, the keywords will be called and used accordingly. These keywords can be called and used many times during the test. The Locator / Data column is the locator value of the screen element or the test data to be passed to that element.


For keyword driven framework, it is not too high for the skill of the creator of the cript test.

This framework also makes our cript tests easier to read


Users should be familiar with the Keyword creation mechanism to be able to effectively take advantage of the benefits provided by the Framework.

Framwork gradually became complicated as it evolved.

5. Hybrid Testing Framework

Hybrid test framework is a combination of two or more of the above framework types. The big plus here is promoting the advantages of the framework that it combines using.

For example, a hybrid that combines a common library with a test data warehouse is input / output data and keyword actions, at which time each set in the data warehouse will include the name of the object, description. , action keyword, UI locator and test data respectively.


If the balance between the combined frameworks is carefully evaluated and implemented, it has a great deal of flexibility for project upgrades and maintenance.


For hybrids, the initial work may be more complex for the approaches that are the frameworks above

6. Behavior Driven Development Framework

The Behavior Driven Developmet Framework is abbreviated as BDD, this framework is not like the aforementioned frameworks, its purpose is to facilitate stakeholders in the software development process such as: Business Analysts, Developers, Testes …

The key issue with this framework is the use of non-technical, semi-formal languages, or more easily understandable that it will be similar to the natural language we often use to describe tests. case according to the user’s behavior. There are a number of tools to support us in this such as Cucumber or Jbehave, Rbehave …


Get access to product specifications as soon as possible.


High cooperation between DEV team and test team is required.

Above is my share of the most popular Test Automation Framework today and pros and cons of each type. Thank you for reading, I hope my article can help somewhat your problems!

Reference link:

Share the news now

Source : Viblo