🌺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