TravelTest Hybrid Automation Framework Design

Business Scenario

Welcome to the QA Automation Team at TravelTest Pvt. Ltd.

The QA Manager has assigned you the task of designing a Hybrid Automation Framework for the TravelTest Web Application Automation Project.

As part of this lab, you will combine the concepts of Data Driven Framework (DDF) and Keyword Driven Framework (KDF) to create a Scalable and Maintainable Automation Framework. You will organize Framework Folders, integrate Reusable Utility Classes and Helper Classes, and manage Test Execution using

Pre-Lab Preparation

  • Configure Java, Selenium WebDriver, and TestNG properly.

  • Ensure the TravelTest automation project runs successfully.

  • Understand the concepts of Data Driven Framework (DDF) and Keyword Driven Framework (KDF).

  • Review Excel handling using Apache POI libraries.

  • Verify parameterized scripts and keyword methods are already implemented.

  • Learn how DDF and KDF can work together in a hybrid framework.

  • Organize test data files, keywords, and utility classes properly.

  • Ensure browser drivers and application access are working correctly.

external Test Data and Keywords. You will also improve Automation Efficiency, Reusability, and Framework Structure for handling large-scale TravelTest Automation Scenarios.

Git Pull

git pull origin branchName

Task 1 :  Combine DDF and KDF

Open the TravelTest Project

1

  • Launch Eclipse or IntelliJ IDEA.

  • Open the TravelTest automation project.

Create Framework Folder Structure

2

  • Organize the project using separate folders such as:

    • testdata

    • keywords

    • utilities

    • testcases

    • drivers

Prepare Excel Files

2

  • Create:

    • TestData.xlsx for test data

    • Keywords.xlsx for keyword steps

Add Apache POI Libraries

4

  • Add Apache POI JAR files to the project build path.

  • Verify there are no dependency errors.

TestCaseKeywordObjectValue
LoginTestEnter TextUsername Admin

Example

Create Utility Classes

5

  • Create reusable utility classes for:

    • Excel reading

    • Browser setup

    • Common Selenium actions

Create Keyword Action Class

6

  • Create the KeywordActions class.

  • Add reusable Selenium methods.

Example:

public class ExcelUtils {

}

Example

public class ExcelUtils {

}

Read Test Data from Excel

7

  • Use Apache POI to fetch input data dynamically.

Example:

 

String username = sheet.getRow(i).getCell(0).getStringCellValue();

Execute Keywords Dynamically

8

  • Read keywords from Excel and map them to methods.

Example:

 

if(keyword.equalsIgnoreCase("Click")) 
{
   action.click(locator);
}

Integrate DDF with KDF

9

  • Pass test data from TestData.xlsx.

  • Execute actions using keywords from Keywords.xlsx.

  • Ensure both frameworks work together in one execution flow.

Execute the Hybrid Framework

10

  • Run the framework using TestNG or Java execution.

  • Observe keyword execution with multiple data sets.

 

Task 2 :  Structure framework folders

Create Main Framework Folders

1

Create Test Cases Package

2

  • Inside the project, create the following folders:

    • testcases

    • testdata

    • utilities

    • keywords

    • drivers

    • reports

  • Inside the testcases folder, create packages for automation scripts.

Example:

 

Create Test Data Folder

3

Create Utilities Folder

4

  • Store Excel files inside the testdata folder.

Example:

 

login
booking
search
TestData.xlsx
Keywords.xlsx

Create Keywords Folder

5

  • Inside the utilities folder, add reusable helper classes.

Example:

ExcelUtils.java
BrowserSetup.java
WaitUtils.java
  • Store keyword-related classes inside the keywords folder.

Example:

KeywordActions.java
KeywordEngine.java

Create Drivers Folder

6

  • Place browser driver files inside the drivers folder.

Example:

 

chromedriver.exe
geckodriver.exe

Create Reports Folder

7

  • Create a reports folder for storing:

    • TestNG reports

    • Screenshots

    • Execution logs

Organize Package Structure

8

  • Arrange all folders and packages properly to maintain clean project architecture.

Example Structure:

TravelTestProject
│
├── testcases
├── testdata
├── utilities
├── keywords
├── drivers
└── reports

Verify Framework Structure

9

  • Refresh the project.

  • Verify all folders are created successfully and organized correctly.

Maintain the Folder Structure

10

  • Store all future scripts, data files, utilities, and reports in their respective folders for better maintainability.

Task 3 : Integrate utilities and helpers

Create Utilities Package

1

  • Inside the project, create a package named utilities.

  • This package will store reusable helper classes.

Create Browser Utility Class

2

Create Excel Utility Class

3

  • Create a class named BrowserSetup.java.

  • Add reusable browser initialization methods.

Example:

 

public void launchBrowser() {
   driver = new ChromeDriver();
}
  • Create a class named ExcelUtils.java.

  • Add methods to read data from Excel files.

Example:

public String getCellData(int row, int col) {
   return sheet.getRow(row).getCell(col).getStringCellValue();
}

Create Wait Utility Class

4

Create Screenshot Helper Class

5

  • Create a class named WaitUtils.java.

  • Add reusable wait methods.

Example:

public void waitForElement(By locator) {
   WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
}
  • Create a class named ScreenshotUtils.java.

  • Add methods for capturing screenshots.

Example:

public void captureScreenshot(String name) {

}

Create Reusable Keyword Methods

6

  • Open the KeywordActions class.

  • Add common Selenium actions.

Example:

public void click(By locator) {
   driver.findElement(locator).click();
}

Initialize Keyword Actions

7

  •  Integrate Utilities into Test Scripts

  • Call utility methods inside automation test classes.

Example:

Use Excel Utility in Framework

8

  • Fetch test data using reusable Excel methods.

Example:

BrowserSetup bs = new BrowserSetup();
bs.launchBrowser();
ExcelUtils excel = new ExcelUtils();
String username = excel.getCellData(1,0);

Execute Browser Actions

9

Validate Reusability

10

Maintain Utility Classes

11

  • Run the automation framework using TestNG or Java execution.

  • Verify utility classes are working correctly.

  • Use the same utility methods across multiple test cases.

  • Confirm that duplicate code is reduced successfully.

  • Store all helper and reusable classes inside the utilities folder.

  • Keep methods generic for future scalability and maintenance.

Organize Framework Structure

1

  • Arrange the project into separate folders:

  • testcases

Task 4 : Build scalable framework

 

  • utilities

  • testdata

  • keywords

  • drivers

  • reports

Verify Test Execution

9

  • Check whether all keywords execute successfully.

  • Verify application behavior for each test step.

Validate Results

10

  • Confirm expected outputs are displayed.

  • Verify assertions and validations pass successfully.

Check Execution Report

11

Update Keywords When Required

12

  • Add new keywords or test steps in Excel.

  • Re-run the framework without changing the core automation code.

Create Reusable Keyword Methods

3

  • Open the KeywordActions class.

  • Move common Selenium actions into reusable methods.

Example:

public void click(By locator) {

   driver.findElement(locator).click();

}

Create Reusable EnterText Method

4

  • Create a common method for text input actions.

Example:

public void enterText(By locator, String value) {
   driver.findElement(locator).sendKeys(value);
}

Centralize Browser Initialization

5

  • Create a reusable browser setup method.

Example:

 

 

public void openBrowser() {

   driver = new ChromeDriver();

}

Store Keywords in Excel

6

  • Open Keywords.xlsx.

  • Maintain reusable keywords instead of hardcoded test steps.

Example:

KeywordAction
ClickClick button
EnterTextEnter Data
VerifyTitleValidate page

Reuse Methods Across Test Cases

7

  • Call the same reusable methods for multiple test scenarios.

  • Avoid writing duplicate Selenium code.

Create Generic Validation Methods

8

  • Create reusable assertion methods.

Example:

 

public void verifyTitle(String expectedTitle) {

   Assert.assertEquals(driver.getTitle(), expectedTitle);

}

Execute Multiple Test Cases

9

  • Call the same reusable methods for multiple test scenarios.

  • Avoid writing duplicate Selenium code.

Validate Framework Reusability

10

  • Add new test cases in Excel without modifying automation code.

  • Confirm the framework handles new scenarios using existing reusable methods.

Maintain Framework Structure

11

  • Organize:

    • Keywords

    • Methods

    • Test data

    • Utility classes

  • Ensure the framework remains clean and maintainable.

 

Good Job!!

You have successfully completed your lab on TravelTest Keyword Driven Framework (KDF), where you learned how to define Reusable Keywords, map them to Selenium Methods, and execute Test Cases using Keyword-Driven Logic.

You also understood how the Keyword Driven Framework improves Reusability, Maintainability, reduces Code Duplication, and simplifies Automation Test Management.

Checkpoint

   Git Push

Next-Lab Preparation

git push origin branchName
  • Setup Cucumber
  • Write feature files
  • Map step definitions
  • Execute BDD scenarios