top of page
Search
Writer's pictureTuyen Nguyen

Hybrid Testing Framework

Updated: Jul 29

As mentioned in Selenium Testing Framework before, we have gone through the two prevalent frameworks (Data-Driven Testing Framework and Keyword-Driven Testing Framework) in Selenium Testing Framework series. Now, we will have a look at Hybrid Testing Framework - an optimized combination of Data-Driven and Keyword-Driven.


I recommend you to have a look at these two frameworks before we continue to explore:

What is Hybrid Testing Framework?


Hybrid framework is a technique wherein we can make the best use of both Data-Driven and Keyword-Driven Testing Framework.

For specification, it uses the data files to contain the keywords related to the application being tested. These keywords describe the set of actions that are required to perform a specific step. And sets of test data can be stored in the same data file or another source (Exel, CSV, JSON, database, ...).

Why Hybrid Testing?


As the name suggests, the Hybrid Testing Framework is a combination of the two above mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.


Hybrid Testing Framework

We use the Keyword-Driven concept to select actions to execute.

We use the Data-Driven concept to execute a set of data within one test script.

When we combine both, that is a Hybrid Framework.

Create a Hybrid Framework


In the example below, you will know about the concept of how to implementing a simple hybrid framework with a practical case. Consider we want to test the login functionality of automatedtestingwithtuyen.com.

Login of automatedtestingwithtuyen.com

For simple, we can write multiple methods in the main test case, in which each test case will test certain functionality. For input email and password, there could be methods. And these input methods can be used multiple times with multiple data set (emails and passwords).

Step 1: Prepare test cases in data files with keywords


The step definitions and related keywords table:


The test cases data set with keywords:

Step 2: Define the test actions

This is where we implement the function code of each method, of how each interacts with SUT.

Since the email and password are passed by the data set, it must be parameterized.

Step 3: Write a test executor/data reader

This class will read the test case data and then drive our test steps by selecting the appropriate methods to execute based on the keywords.

It is also responsible for reading the data set for parameterized values.

So in case, we add more test cases in test files (Excel, CSV, JSON, database, etc), we need to specify the actions we want to use by listing down the keywords and the data we want to test. The test executor will read the data file, read the keywords, trigger the actions that we had already implemented with the data to test.


We can make it more advanced by replacing the Switch conditions with Java Reflection Class.

Advantages of Hybrid Testing Framework


Hybrid Testing Framework offers some advantages:

  1. Once the framework is set up, manual testers or non-technical testers can easily write test scripts for automation.

  2. Test application with multiple sets of data with just the same script during regression testing.

  3. As data is maintained in separated files and no coding is exposed, the test scripts are easy to read and understand. Keywords & actions resemble so closely manual test cases, which become easier to write and maintain.

  4. Save time to re-implement the actions of many tests. Increase further the reusability of the automation project.

  5. Any changes in the method's implementation will focus on only one class, easy to modify, maintain and expend.

  6. The same test cases can be executed several times which helps to reduce test case and scripts


Disadvantages of Hybrid Testing Framework


Some drawbacks that we can face:

  1. Quality of the test depends on automation skills of implementing team members.

  2. Another tester is required to have great expertise over the scripting language of the test tool so that he/she can successfully create customized functions and utilities required for the particular application.

  3. Data validation is time-consuming when testing a large number of test cases.


Conclusion

  1. A Hybrid testing framework is a technique combine from both Data-Driven and Keyword-Driven.

  2. In this framework, input data sets and keywords can be stored in single or multiple data sources like XLS, XML, CSV, and databases.

  3. Hybrid Testing Framework resolves the issue of both test scripts and methods' reusability by implementing the action just one time and using the keyword to trigger the related actions with the data.

  4. Drawback of this method is that it is depended on automation skills.

443 views0 comments

Comments


bottom of page