# sanjanagawali/selenium-project architecture

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

- Interactive diagram: https://gitdiagram.com/sanjanagawali/selenium-project
- Repository: https://github.com/sanjanagawali/selenium-project

## Overview

##### Project type and purpose
- This is a Selenium‐based automated testing mini‐project written in Java.
- Purpose: run end‐to‐end UI tests against an auction web application using Firefox (via geckodriver) and generate TestNG reports.

##### File structure
- Top‐level:
- README.md – project description
- Selenium_Mini_Project/
– bin/            compiled classes
– driver/         contains geckodriver.exe
– src/            Java test code (Sample.java)
– test-output/    TestNG & JUnit‐style test reports and assets
- Patterns:
- src → test code (drives tests via Selenium API)
- driver → third‐party binary (WebDriver executable)
- test-output → generated artifacts (HTML, XML)

##### README for additional insights
- Confirms:
- Tests executed against an “auction webapp”
- Uses Firefox WebDriver (geckodriver)
- TestNG for orchestration and reporting

##### Main components
a. Test Code Layer
- Sample.java (JUnit/TestNG test classes)
- Selenium Java Client Library
b. Test Runner / Framework
- TestNG core engine (reads annotations, manages test lifecycle)
- TestNG Reporter (generates HTML/XML under test-output/)
c. WebDriver Infrastructure
- geckodriver.exe (in driver/)
- Firefox Browser (actual SUT host)
d. System Under Test (SUT)
- Auction Web Application (remote or local web server)
e. Artifact Storage
- bin/ (compiled .class files)
- test-output/ (reports, logs)

##### Relationships & data flows
- TestNG invokes Sample.java test methods
- Sample.java calls Selenium WebDriver API
- WebDriver API communicates via JSON-over-HTTP to geckodriver.exe
- geckodriver.exe drives Firefox, sending user actions to the Auction Web App and receiving DOM responses
- Test results flow back to TestNG, which writes reports into test-output/

##### Key architectural patterns & design principles
- Layered separation: Test code → Test framework → WebDriver → Browser → SUT
- Externalization of binary dependencies (driver/)
- Test reporting as a distinct I/O component

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Test Code Layer
    subgraph "Test Code Layer"
        direction TB
        sample["Sample.java"]:::testcode
        selenium["Selenium Java Client"]:::testcode
    end

    %% Test Framework Layer
    subgraph "Test Framework Layer"
        direction TB
        testngRunner["TestNG Core Engine"]:::framework
        testngReporter["TestNG Reporter"]:::framework
    end

    %% WebDriver Infrastructure
    subgraph "WebDriver Infrastructure"
        direction TB
        gecko["geckodriver.exe"]:::binary
        firefox["Firefox Browser"]:::browser
    end

    %% System Under Test
    subgraph "System Under Test"
        direction TB
        auction["Auction Web Application"]:::sut
    end

    %% Artifact Storage
    subgraph "Artifact Storage"
        direction TB
        bin["Compiled .class files (bin/)"]:::storage
        testOutput["TestNG Reports (test-output/)"]:::storage
        defaultSuite["Default suite/"]:::storage
        emailable["emailable-report.html"]:::storage
        index["index.html"]:::storage
        junitXml["junitreports/TEST-Sample.xml"]:::storage
        oldSuite["old/Default suite/"]:::storage
        testngResults["testng-results.xml"]:::storage
    end

    %% Connections
    testngRunner -->|"invokes"| sample
    sample -->|"uses"| selenium
    testngRunner -->|"uses Reporter"| testngReporter
    selenium -->|"JSON/HTTP"| gecko
    gecko -->|"drives"| firefox
    firefox -->|"DOM requests"| auction
    auction -->|"DOM responses"| firefox
    firefox -->|"outputs"| gecko
    gecko -->|"HTTP responses"| selenium
    selenium -->|"returns"| sample
    testngRunner -->|"writes reports"| testOutput
    testngReporter -->|"generates artifacts"| testOutput
    testOutput --> defaultSuite
    testOutput --> emailable
    testOutput --> index
    testOutput --> junitXml
    testOutput --> oldSuite
    testOutput --> testngResults
    bin -.-> sample

    %% Click Events
    click sample "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/src/Sample.java"
    click bin "https://github.com/sanjanagawali/selenium-project/tree/master/Selenium_Mini_Project/bin/"
    click gecko "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/driver/geckodriver.exe"
    click testOutput "https://github.com/sanjanagawali/selenium-project/tree/master/Selenium_Mini_Project/test-output/"
    click defaultSuite "https://github.com/sanjanagawali/selenium-project/tree/master/Selenium_Mini_Project/test-output/Default suite/"
    click emailable "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/test-output/emailable-report.html"
    click index "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/test-output/index.html"
    click junitXml "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/test-output/junitreports/TEST-Sample.xml"
    click oldSuite "https://github.com/sanjanagawali/selenium-project/tree/master/Selenium_Mini_Project/test-output/old/Default suite/"
    click testngResults "https://github.com/sanjanagawali/selenium-project/blob/master/Selenium_Mini_Project/test-output/testng-results.xml"

    %% Styles
    classDef testcode fill:#ADD8E6,stroke:#000,color:#000
    classDef framework fill:#90EE90,stroke:#000,color:#000
    classDef binary fill:#FFA500,stroke:#000,color:#000
    classDef browser fill:#FFB347,stroke:#000,color:#000
    classDef sut fill:#F5DEB3,stroke:#000,color:#000
    classDef storage fill:#DDA0DD,stroke:#000,color:#000
```
