# pratikbarjatya/keyword-driven-framework architecture

> Architecture diagram of the GitHub repository pratikbarjatya/keyword-driven-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pratikbarjatya/keyword-driven-framework
- Repository: https://github.com/pratikbarjatya/keyword-driven-framework

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
graph TB
    %% CI/CD and Build
    Jenkins["Jenkins (CI/CD)"]:::ci
    Maven["pom.xml"]:::maven
    Gitignore[".gitignore"]:::misc
    Readme["README.md"]:::docs
    Idea[".idea/"]:::ide
    Project[".project & .settings/"]:::ide
    Jar["Framework JAR\n(target/Keyword_Driven_Framework-1.0-SNAPSHOT.jar)"]:::artifact

    %% Test Execution
    Runner["Keyword_Driven_Framework.java\n(Test Runner Entry Point)"]:::runner
    DriverScript["DriverScript / Keyword Engine"]:::orchestration

    %% Core Components
    TestData["Excel Test Data Store"]:::data
    OR["Object Repository\n(config.properties/OR files)"]:::data
    KeywordLib["Keyword Library\n(Login, Click, Type, etc.)"]:::library
    WebDriverInterface["WebDriver Interface"]:::interface
    Browser["Browser / AUT"]:::browser

    %% Utilities
    Logging["Log4j Logging Module"]:::utility
    Reporting["ReportUtil Reporting Module"]:::utility
    Email["SendMail Module"]:::utility

    %% Optional Integrations
    SeleniumGrid["Selenium Grid"]:::optional
    SauceLabs["SauceLabs"]:::optional

    %% Connections
    Jenkins -->|"invokes Maven"| Maven
    Maven -->|"runs tests"| Runner
    Runner -->|"calls"| DriverScript

    DriverScript -->|"reads data"| TestData
    DriverScript -->|"reads locators"| OR
    DriverScript -->|"invokes methods"| KeywordLib

    KeywordLib -->|"uses"| WebDriverInterface
    WebDriverInterface -->|"drives"| Browser
    KeywordLib -->|"captures on failure"| Logging

    Runner -->|"logs events"| Logging
    Runner -->|"assembles reports"| Reporting
    Reporting -->|"optional email"| Email

    WebDriverInterface -.->|"optional"| SeleniumGrid
    WebDriverInterface -.->|"optional"| SauceLabs

    %% Click events for component mapping
    click Maven "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/pom.xml"
    click Runner "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/src/test/java/com/keyword/Keyword_Driven_Framework.java"
    click Jar "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/target/Keyword_Driven_Framework-1.0-SNAPSHOT.jar"
    click Gitignore "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/.gitignore"
    click Readme "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/README.md"
    click Idea "https://github.com/pratikbarjatya/keyword-driven-framework/tree/master/.idea/"
    click Project "https://github.com/pratikbarjatya/keyword-driven-framework/blob/master/.project"
    click Project "https://github.com/pratikbarjatya/keyword-driven-framework/tree/master/.settings/"

    %% Styles
    classDef ci fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef maven fill:#a2d2ff,stroke:#0366d6,stroke-width:1px
    classDef runner fill:#bdb2ff,stroke:#6535c9,stroke-width:1px
    classDef orchestration fill:#8ecae6,stroke:#0077b6,stroke-width:1px
    classDef library fill:#ffb703,stroke:#fb8500,stroke-width:1px
    classDef data fill:#caffbf,stroke:#2d6a4f,stroke-width:1px
    classDef interface fill:#bde0fe,stroke:#023e8a,stroke-width:1px
    classDef browser fill:#ffd6a5,stroke:#ff7f11,stroke-width:1px
    classDef utility fill:#ffadad,stroke:#d00000,stroke-width:1px
    classDef optional fill:#e0e0e0,stroke-dasharray: 5 5
    classDef misc fill:#eeeeee,stroke:#666,stroke-width:1px
    classDef docs fill:#e9d8a6,stroke:#b58900,stroke-width:1px
    classDef ide fill:#c8c8c8,stroke:#555,stroke-width:1px
    classDef artifact fill:#d8f3dc,stroke:#40916c,stroke-width:1px
```
