๐ŸŒบHybrid Framework

๐Ÿ“š Hybrid Framework

Combines multiple frameworks into one.

๐Ÿ‘ช Keyword-Driven + Data-Driven

Most common hybrid framework.

  • Keywords represent reusable test steps.

  • Test data is externalized into files.

  • Keywords read data from files.

Execution Flow

  • ๐Ÿ“„ Test case file lists keywords to execute

  • ๐Ÿ—๏ธ Keyword methods contain test logic

  • ๐Ÿ“Š Keywords read data from external files

  • โ†ป Iterates through multiple data sets

๐Ÿ‘ Benefits

  • ๐Ÿงฉ Modularity of Keyword-driven

  • ๐Ÿ“ˆ Scalability of Data-driven

  • ๐Ÿ’ช๐Ÿฝ Power of both frameworks

๐Ÿ”€ Example Hybrid Framework for CNBC

//Test Steps
public class TestSteps{
  
  public login(String username, String password){
    //login logic
  }
  
  public searchArticle(String term){
   //search logic
  }

}

//Test Case File 
TC1 | login | searchArticle
TC2 | login | searchArticle

//Test Data
username,password
john,1234
sarah,5678

//Test Executor
keywords = new TestSteps()

for(data in testdata){
  username = data.username
  password = data.password
  
  keywords.login(username,password)
  keywords.searchArticle("stocks")

}

Visual Representation ๐Ÿ’ก

Here is a visual representation of the execution flow of the hybrid framework:

Test Case File -> Keyword Methods -> External Files -> Test Executor

The test case file lists the keywords that need to be executed. The keyword methods contain the test logic for each keyword. The external files provide the values for the parameters used by the keyword methods. The test executor iterates through the test case file and executes the keyword methods, passing in the appropriate values from the external files.

Last updated