# mukesh-50/seleniumframeworkjanbatch2025 architecture

> Architecture diagram of the GitHub repository mukesh-50/seleniumframeworkjanbatch2025, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mukesh-50/seleniumframeworkjanbatch2025
- Repository: https://github.com/mukesh-50/seleniumframeworkjanbatch2025

## Overview

##### Project type and purpose
- This is a Selenium-based test automation framework built in Java, using Maven for build management and TestNG for test orchestration.
- Purpose: Execute cross-browser UI tests against a web application, driven by data from Excel and configurable via properties files.

##### File structure
- Top-level build & config
– pom.xml: Maven coordinates, dependencies, Surefire plugin configuration.
– Configuration/config.properties: global key-value settings (URLs, timeouts, browser types).
– XMLFiles/testng.xml: TestNG suite definition.
- Core source (src/main/java)
– base/BaseClass.java: common setup & teardown (initializes WebDriver).
– factory/BrowserFactory.java: instantiates WebDriver instances per browser type.
– pages/*.java: Page Object Model (POM) classes representing UI screens.
– dataprovider/*.java: ConfigUtility (reads config.properties), ExcelUtility (reads TestData.xlsx), DataProviders (links TestNG @DataProvider to Excel).
– helper/Utility.java: general-purpose helper methods (screenshots, waits, logging).
– listener/*.java: TestNG listeners (MyTestNGListener for reporting, RetryAnalyzer/RetryTransformer for test retries).
- Test source (src/test/java)
– testcases and Bhakti_Testcase packages: TestNG test classes driving scenarios.
– src/test/resources/chaintest.properties: test-specific configuration.
- Test data & reports
– TestData/TestData.xlsx: input data for data-driven tests.
– test-output/: TestNG generated HTML/XML reports and logs.

##### README for insights
- Instructions focus on ‘mvn clean test -Dtestsuitefile=testng.xml’ – Maven kick-off, passing suite file.

a. Main components
1. Build & Execution Layer
– Maven CLI → Surefire Plugin → launches TestNG
2. TestNG Orchestration
– testng.xml defines suites/tests → TestNG Test Runner
– Listeners & Retry Mechanism
3. Test Logic Layer
– Test Classes (@Test methods)
– Data Providers (ExcelUtility & ConfigUtility)
4. Framework Core
– BaseClass (setup/teardown)
– BrowserFactory (WebDriver initiation)
– POM Classes (UI interaction)
– Helper Utilities (waits, screenshots, logging)
5. External Resources
– config.properties & chaintest.properties
– TestData.xlsx
– Application Under Test (web application endpoints)
6. Reporting & Artifacts
– test-output folder: HTML/XML reports, JUnit style outputs
b. Relationships & interactions
– Maven invokes TestNG with testng.xml.
– TestNG instantiates Test Classes; BaseClass uses BrowserFactory to launch browser.
– Test methods call Page Objects (DashboardPage, LoginPage) to send commands via WebDriver.
– DataProviders feed test methods with inputs from ExcelUtility and ConfigUtility.
– Listeners capture test events, log results, trigger retries via RetryAnalyzer.
– Upon test completion, reports written to test-output.
c. Architectural patterns & design principles
– Page Object Model (separation of UI locators/behaviors from test code).
– Factory Pattern (BrowserFactory for WebDriver instantiation).
– Data-Driven Testing (TestNG @DataProvider tied to Excel).
– Listener & Retry Strategy (TestNG extension points).
d. Key technologies & libraries
– Java, Selenium WebDriver, TestNG, Apache POI (ExcelUtility), Maven

##### Elements
– Labels: “Maven”, “TestNG Runner”, “Listeners/Retry”, “BaseClass”, “BrowserFactory”, “Page Objects”, “Test Classes”, “DataProviders”, “ExcelUtility”, “ConfigUtility”, “test-output.”
- Maven → TestNG
- TestNG → BaseClass.setup() → BrowserFactory → WebDriver → Application Under Test
- Test Methods → Page Objects → WebDriver
- Test Methods ← DataProviders ← ExcelUtility/ConfigUtility
- TestNG Listeners → Reporting (test-output)
- Core framework (green)
- Test code (orange)
- External resources (gray)
- Reports/Artifacts (yellow)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Execution Layer
    subgraph "Build & Execution Layer"
        direction TB
        MavenCLI["Maven CLI"]:::build
        Surefire["Surefire Plugin"]:::build
    end

    %% TestNG Orchestration
    subgraph "TestNG Orchestration"
        direction TB
        TestNGRunner["TestNG Runner"]:::orchestration
    end

    %% Framework Core
    subgraph "Framework Core"
        direction TB
        BaseClass["BaseClass"]:::core
        BrowserFactory["BrowserFactory"]:::core
        subgraph "Page Objects"
            direction TB
            LoginPage["LoginPage"]:::core
            DashboardPage["DashboardPage"]:::core
        end
        subgraph "Data Providers & Utilities"
            direction TB
            ConfigUtility["ConfigUtility"]:::core
            ExcelUtility["ExcelUtility"]:::core
            DataProviders["DataProviders"]:::core
            Utility["Utility"]:::core
        end
        subgraph "Listeners & Retry"
            direction TB
            MyListener["MyTestNGListener"]:::core
            RetryAnalyzer["RetryAnalyzer"]:::core
            RetryTransformer["RetryTransformer"]:::core
        end
    end

    %% Test Logic Layer
    subgraph "Test Logic Layer"
        direction TB
        TestClasses["Test Classes"]:::test
    end

    %% External Resources
    subgraph "External Resources"
        direction TB
        GlobalConfig["Global Config\n(config.properties)"]:::external
        TestConfig["Test Config\n(chaintest.properties)"]:::external
        TestData["TestData.xlsx"]:::external
        AUT["Application Under Test"]:::external
    end

    %% Reporting & Artifacts
    subgraph "Reporting & Artifacts"
        direction TB
        Reports["test-output"]:::report
    end

    %% Connections
    MavenCLI --> Surefire
    Surefire --> TestNGRunner
    TestNGRunner --> BaseClass
    TestNGRunner --> MyListener
    TestNGRunner --> TestClasses
    BaseClass --> BrowserFactory
    BrowserFactory -->|"initiates WebDriver"| AUT
    TestClasses --> BaseClass
    TestClasses --> DataProviders
    TestClasses --> LoginPage
    TestClasses --> DashboardPage
    DataProviders --> ConfigUtility
    DataProviders --> ExcelUtility
    ConfigUtility --> GlobalConfig
    ExcelUtility --> TestData
    LoginPage -->|"WebDriver actions"| AUT
    DashboardPage -->|"WebDriver actions"| AUT
    MyListener --> Reports
    TestClasses --> Reports

    %% Click Events
    click MavenCLI "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/pom.xml"
    click TestNGRunner "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/XMLFiles/testng.xml"
    click GlobalConfig "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/Configuration/config.properties"
    click TestConfig "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/test/resources/chaintest.properties"
    click TestData "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/TestData/TestData.xlsx"
    click BaseClass "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/base/BaseClass.java"
    click BrowserFactory "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/factory/BrowserFactory.java"
    click LoginPage "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/pages/LoginPage.java"
    click DashboardPage "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/pages/DashboardPage.java"
    click ConfigUtility "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/dataprovider/ConfigUtility.java"
    click ExcelUtility "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/dataprovider/ExcelUtility.java"
    click DataProviders "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/dataprovider/DataProviders.java"
    click Utility "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/helper/Utility.java"
    click MyListener "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/listener/MyTestNGListener.java"
    click RetryAnalyzer "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/listener/RetryAnalyzer.java"
    click RetryTransformer "https://github.com/mukesh-50/seleniumframeworkjanbatch2025/blob/main/src/main/java/listener/RetryTransformer.java"

    %% Styles
    classDef build fill:#cce5ff,stroke:#004085,color:#004085;
    classDef orchestration fill:#d6d8d9,stroke:#343a40,color:#343a40;
    classDef core fill:#d4edda,stroke:#155724,color:#155724;
    classDef test fill:#ffe5b4,stroke:#e69500,color:#e69500;
    classDef external fill:#f8f9fa,stroke:#6c757d,color:#6c757d;
    classDef report fill:#fff3cd,stroke:#856404,color:#856404;
```
