# midhunnand1313/obsqura_automation architecture

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

- Interactive diagram: https://gitdiagram.com/midhunnand1313/obsqura_automation
- Repository: https://github.com/midhunnand1313/obsqura_automation

## Overview

##### Project Type and Purpose
- This is a Selenium-TestNG automation framework repository (“Obsqura_Automation”) composed of three Maven sub-projects:
- 7Rmart – a full Page-Object-Model (POM) framework for automating an admin-portal web application
- AutomationJava – a collection of standalone Selenium/Java practice scripts
- TestNGprojects – another TestNG-based sample automation suite
- Each uses Maven for build/dependency management, TestNG for orchestration, Selenium WebDriver to drive browsers, and utilities for cross-cutting concerns (reports, waits, data handling).

##### File Structure & Architectural Insights
- 7Rmart (the most complete POM example) has:
– src/main/java/constants – global strings/URLs/etc.
– src/main/java/pages – one class per page, encapsulating locators and actions (POM)
– src/main/java/utilities – helpers (Excel reading, waits, file uploads, report extensions)
– src/main/resources/config.properties + TestData.xlsx – externalized configuration and test data
– src/test/java/baseConfiguration – WebDriver setup/teardown (Base class)
– src/test/java/dataProvider – TestNG @DataProvider implementations
– src/test/java/listeners – TestNG Listeners & RetryAnalyzer for screenshots, re-runs, report hooks
– src/test/java/testScipt – TestNG test classes invoking page methods
– testng XMLs for defining suites (cross-browser, grouping, retry)
– extent-reports + test-output folders – generated HTML reports
- AutomationJava & TestNGprojects share a similar TestNG-only pattern (no POM, only scripts under testScript).

##### Key Components
a. Build & Dependency Layer
– Maven (pom.xml) resolves dependencies (Selenium, TestNG, ExtentReports) and executes tests.
b. Test Runner
– TestNG invokes test classes per testng.xml, driving parallelism, groups, retries.
c. Test Code
– TestNG @Test classes (src/test/java/testScipt, testScript2) implement high-level scenarios.
d. Page Object Layer (for 7Rmart)
– Page classes encapsulate page elements + actions, serving as a façade to WebDriver.
e. Utilities
– ExcelUtility, WaitUtility, FileUploadUtility, ExtendReportUtility, RandomDataUtility.
f. Configuration & Test Data
– config.properties, TestData.xlsx.
g. WebDriver & Browser Instances
– ChromeDriver, EdgeDriver, etc., instantiated in Base class.
h. AUT (Application Under Test)
– The web application endpoints under test (e.g., 7Rmart admin portal).
i. Reporting & Listeners
– TestNG Listeners capture events (onTestFailure to take screenshots), plug into ExtentReports; TestNG default reports.

##### Relationships & Interactions
- Maven → triggers → TestNG Runner
- TestNG → loads → testng-XML suites → executes → Test Classes
- Test Classes → instantiate/use → Base class → WebDriver → browsers
- Test Classes → call → Page Objects → WebDriver calls (findElement, click, type)
- Page Objects / Test Classes → leverage → Utilities (waits, data, screenshots)
- DataProviders → pull → TestData.xlsx / config.properties
- Listeners → intercept → Test events → log to → ExtentReports + produce → test-output HTML/XML
- Browsers ↔ communicate ↔ AUT (over HTTP)

##### Architectural Patterns & Principles
- Page Object Model (separation of locators and tests)
- Data Provider pattern (TestNG @DataProvider for data-driven testing)
- Utility classes for cross-cutting concerns (Single Responsibility)
- Listener interceptors (Observer/AOP for logging, screenshots, retries)
- Maven’s declarative build (Convention over Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Build & Dependency Layer"
        M7["7Rmart/pom.xml"]:::orchestration
        MAJ["AutomationJava/pom.xml"]:::orchestration
        MTNP["TestNGprojects/pom.xml"]:::orchestration
    end

    subgraph "Test Runner (TestNG)"
        TR["TestNG Runner"]:::orchestration
    end

    subgraph "TestNG XML Suites"
        X1["testng.xml"]:::orchestration
        X2["grouping_testng.xml"]:::orchestration
        X3["Cross_Browser_TestingNG.xml"]:::orchestration
        X4["Multi_Browser_TestingNG2.xml"]:::orchestration
        X5["retry_testng.xml"]:::orchestration
    end

    subgraph "Test Code"
        T7["7Rmart Tests"]:::test
        TAJ["AutomationJava Scripts"]:::test
        TNP["TestNGprojects Scripts"]:::test
    end

    subgraph "Page Objects"
        POM["Pages (POM)"]:::framework
    end

    subgraph "Utilities"
        UTIL["Utilities"]:::framework
    end

    subgraph "WebDriver & Browsers"
        BASE["Base Class"]:::framework
        WDI["WebDriver Instances"]:::external
    end

    subgraph "External Resources"
        CFG["config.properties"]:::data
        TD["TestData.xlsx"]:::data
        AUT["Application Under Test"]:::external
    end

    subgraph "Reporting & Logs"
        ER["extent-report.html"]:::data
        TO["test-output"]:::data
    end

    M7 --> TR
    MAJ --> TR
    MTNP --> TR
    TR -->|reads| X1
    TR -->|reads| X2
    TR -->|reads| X3
    TR -->|reads| X4
    TR -->|reads| X5
    TR -->|executes| T7
    TR -->|executes| TAJ
    TR -->|executes| TNP

    T7 -->|calls| POM
    T7 -->|uses| UTIL
    TAJ -->|uses| UTIL
    TNP -->|uses| UTIL

    T7 -->|instantiates| BASE
    BASE -->|creates| WDI
    POM -->|wraps| WDI

    T7 -->|reads| CFG
    T7 -->|reads| TD
    UTIL -->|reads| CFG
    UTIL -->|reads| TD

    WDI -->|connects| AUT

    UTIL -->|logs to| ER
    UTIL -->|generates| TO
    TR -->|generates| TO

    click M7 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/pom.xml"
    click MAJ "https://github.com/midhunnand1313/obsqura_automation/blob/main/AutomationJava/pom.xml"
    click MTNP "https://github.com/midhunnand1313/obsqura_automation/blob/main/TestNGprojects/pom.xml"
    click X1 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/testng.xml"
    click X2 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/grouping_testng.xml"
    click X3 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/Cross_Browser_TestingNG.xml"
    click X4 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/Multi_Browser_TestingNG2.xml"
    click X5 "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/retry_testng.xml"
    click T7 "https://github.com/midhunnand1313/obsqura_automation/tree/main/7Rmart/src/test/java/testScipt"
    click TAJ "https://github.com/midhunnand1313/obsqura_automation/tree/main/AutomationJava/src/test/java/testScript"
    click TNP "https://github.com/midhunnand1313/obsqura_automation/tree/main/TestNGprojects/src/test/java/testScript3"
    click POM "https://github.com/midhunnand1313/obsqura_automation/tree/main/7Rmart/src/main/java/pages"
    click UTIL "https://github.com/midhunnand1313/obsqura_automation/tree/main/7Rmart/src/main/java/utilities"
    click BASE "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/src/test/java/baseConfiguration/Base.java"
    click CFG "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/src/main/resources/config.properties"
    click TD "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/src/test/resources/TestData.xlsx"
    click ER "https://github.com/midhunnand1313/obsqura_automation/blob/main/7Rmart/extent-reports/extent-report.html"
    click TO "https://github.com/midhunnand1313/obsqura_automation/tree/main/7Rmart/test-output"

    classDef orchestration fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef test fill:#98FB98,stroke:#333,stroke-width:1px
    classDef framework fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#FFFF00,stroke:#333,stroke-width:1px
```
