How pratikbarjatya/keyword-driven-framework works
Project type and purpose
• This is a Java-based Selenium Automation Framework (Keyword-Driven/Hybrid) managed by Maven.
• Purpose: provide a reusable, application-independent test execution environment that reads keyword tables (Excel/JXL), drives a browser via WebDriver, logs results, generates reports, and optionally emails them.
File structure
• Top-level files: .gitignore, pom.xml → Maven project, defines dependencies (Selenium, TestNG, JXL/POI, Log4j).
• src/test/java/com/keyword/Keyword_Driven_Framework.java → the driver script / entry point lives under test scope.
• Absence of src/main suggests everything is packaged as test-only library (target/Keyword_Driven_Framework-1.0-SNAPSHOT.jar).
• IDE metadata (.idea, .settings) indicates Eclipse/IntelliJ usage.
• README outlines additional packages (com.totsy.config, log, utils, xls) that form the intended modular structure:
• config (properties, OR)
• test (DriverScript, Keywords, constants)
• utils (report generation, zipping, mailing)
• xls (test data)
• log (Log4j outputs)
Extract architectural insights from the README
• Core components:
a. Keyword Library: reusable, application-independent methods (Login, Click, Type, MouseHover, JavaScriptExecutor wrappers).
b. Driver Script: reads keyword tables, orchestrates execution.
c. Object Repository: externalize locators.
d. Data Tables (Excel files via JXL or Apache POI).
e. Reporting & Logging (Log4j + custom ReportUtil).
f. Email module (SendMail).
g. Screenshot capture on failure.
• Technical stack: Java 7+, Selenium WebDriver 2+, TestNG, JXL/POI, Log4j, Maven, Jenkins (CI), optional Selenium Grid/SauceLabs.
1. Test Runner (TestNG/JUnit)
2. DriverScript / Keyword Engine
3. Keyword Library
4. Object Repository (OR files / config.properties)
5. Test Data Store (Excel/XLS files)
6. Selenium WebDriver Interface
7. Browser/ AUT (Application Under Test)
8. Reporting Module (ReportUtil)
9. Logging Module (Log4j)
10. Email Sender (SendMail)
11. CI/CD System (Jenkins)
• CI/CD → invokes Maven → runs Test Runner
• Test Runner → calls DriverScript
• DriverScript → reads OR & Test Data
• DriverScript → invokes Keyword Library methods
• Keyword Library → calls WebDriver Interface
• WebDriver Interface → drives Browser → interacts with AUT
• Keyword Library → on failure captures Screenshot
• Throughout execution → Logging Module receives events
• End of suite → Reporting Module assembles results → hands off to Email Sender (optional)
c. Architectural patterns & principles:
• Keyword-Driven Architecture: orchestration layer (DriverScript) decoupled from implementation (Keyword Library).
• Data-Driven elements: external test data separate from code.
• Separation of Concerns:
• Config & OR
• Execution & orchestration
• Interaction (WebDriver)
• Utilities (reports, mail)
• Maven for build & dependency management.
d. Key technologies/frameworks:
• Java + Maven
• Selenium WebDriver
• TestNG (or JUnit) test runner
• JXL / Apache POI for Excel
• Log4j for logging
• Custom ReportUtil / SendMail