# dhanusheswaranm/python_selenium architecture

> Architecture diagram of the GitHub repository dhanusheswaranm/python_selenium, 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/dhanusheswaranm/python_selenium
- Repository: https://github.com/dhanusheswaranm/python_selenium

## Overview

##### Project type and purpose
- This repo is a monorepo of multiple Python‐based Selenium test automation frameworks, each organized around the Page Object Model (POM) pattern.
- Its primary purpose is end-to-end UI testing of web applications: tests drive a browser via Selenium, use page classes to abstract element locators and actions, read data/config from Excel or INI files, and emit JSON/XML/HTML reports.

##### File structure
- Top‐level folders correspond to individual sample frameworks (DemoPythonSelenium, POM, PageObjectModel, Task, Task2, datadriframe, fixture, pagefactory, pytest).
- Within each:
- Pages or Pages/**HomePage.py**, **SearchPage.py** → Page Object layer
- Tests or Tests/**test_*.py**, **conftest.py** → Test layer (pytest fixtures, test cases)
- Utility or Utilities/**read_config.py**, **excelReader.py** → Helpers (config reader, data provider)
- config.ini files → External configuration
- ExcelFiles/*.xlsx → Test data
- Reports or XMLReport.xml / report.html → Test results
- hooksfunctionallevel.py / consolelogger.py → Logging and hooks
- There are also common elements: .vscode settings, a root README.md, and various __pycache__.

##### Detail
- Config files and data sources explicitly.
- Don’t omit the pytest fixture layer – it’s where browser setup and teardown happen.
- Both synchronous (test → page) and asynchronous or plugin-based (pytest hooks → logger) flows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs
    subgraph "Pre-test Setup"
        direction TB
        subgraph "Configuration Module"
            direction TB
            CFG1["POM/config.ini"]:::external
            CFG2["pagefactory/configuration/config.ini"]:::external
            CFG3["Task/config.ini"]:::external
            CFG4["Task2/configuration/config.ini"]:::external
            CFG5["datadriframe/config.ini"]:::external
            CFG6["PageObjectModel/config.ini"]:::external
        end
        subgraph "Data Provider"
            direction TB
            DP1["Task/excelReader.py"]:::code
            DP2["Task2/Utils/ExcelReader.py"]:::code
            DP3["datadriframe/excelReader.py"]:::code
            DP4["Task/ExcelData/LoginData.xlsx"]:::external
            DP5["Task2/Utils/LoginDataForOrangeHRM.xlsx"]:::external
            DP6["datadriframe/ExcelFiles/loginData.xlsx"]:::external
        end
    end

    subgraph "Test Execution"
        direction TB
        TR["Test Runner (pytest)"]:::code
        subgraph "Test Layer"
            direction TB
            TL1["POM/Tests/test_search.py"]:::code
            TL2["POM/Tests/conftest.py"]:::code
            TL3["pagefactory/Tests/test_search.py"]:::code
            TL4["pagefactory/Tests/conftest.py"]:::code
            TL5["Task/test_loginSauceDemo.py"]:::code
            TL6["Task/conftest.py"]:::code
            TL7["Task2/Tests/test_login.py"]:::code
            TL8["Task2/Tests/conftest.py"]:::code
            TL9["datadriframe/test_login.py"]:::code
            TL10["datadriframe/test_excelLogin.py"]:::code
            TL11["datadriframe/conftest.py"]:::code
            TL12["PageObjectModel/tests/test_Search.py"]:::code
            TL13["PageObjectModel/tests/conftest.py"]:::code
        end
        subgraph "Page Object Layer"
            direction TB
            PO1["POM/Pages/HomePage.py"]:::code
            PO2["POM/Pages/SearchPage.py"]:::code
            PO3["pagefactory/Pages/HomePage.py"]:::code
            PO4["pagefactory/Pages/SearchPage.py"]:::code
            PO5["Task2/Pages/BasePage.py"]:::code
            PO6["Task2/Pages/loginpage.py"]:::code
            PO7["Task2/Pages/dashboardPage.py"]:::code
            PO8["PageObjectModel/pages/HomePage.py"]:::code
            PO9["PageObjectModel/pages/SearchPage.py"]:::code
        end
        subgraph "Utility/Helper Modules"
            direction TB
            UH1["POM/Utility/read_config.py"]:::code
            UH2["pagefactory/Utilities/read_config.py"]:::code
            UH3["pagefactory/Utilities/consolelogger.py"]:::code
            UH4["fixture/hooksfunctionallevel.py"]:::code
            UH5["PageObjectModel/utilities/read_config.py"]:::code
            UH6["Task/read_config.py"]:::code
            UH7["datadriframe/read_config.py"]:::code
        end
        WD["Selenium WebDriver"]:::infra
        B["Browser"]:::infra
    end

    subgraph "Post-test Reporting"
        direction TB
        RM1["POM/Reports/*.json"]:::output
        RM2["pagefactory/XMLReport.xml"]:::output
        RM3["pagefactory/report.html"]:::output
        RM4["pagefactory/Reports/*.json, *.txt"]:::output
        RM5["pytest/XMLReport.xml"]:::output
        RM6["pytest/report.html"]:::output
        LM["pagefactory/logfile.log"]:::output
    end

    %% Connections
    CFG1 -->|reads config| TR
    CFG2 -->|reads config| TR
    CFG3 -->|reads config| TR
    CFG4 -->|reads config| TR
    CFG5 -->|reads config| TR
    CFG6 -->|reads config| TR
    DP1 -->|provides data| TR
    DP2 -->|provides data| TR
    DP3 -->|provides data| TR
    DP4 -->|provides data| TR
    DP5 -->|provides data| TR
    DP6 -->|provides data| TR

    TR -->|"runs tests"| TL1
    TR -->|runs tests| TL3
    TR -->|runs tests| TL5
    TR -->|runs tests| TL7
    TR -->|runs tests| TL9
    TR -->|runs tests| TL12

    TL2 -->|fixture| WD
    TL4 -->|fixture| WD
    TL6 -->|fixture| WD
    TL8 -->|fixture| WD
    TL11 -->|fixture| WD
    TL13 -->|fixture| WD

    TL1 -->|calls| PO1
    TL3 -->|calls| PO3
    TL5 -->|calls| PO5
    TL7 -->|calls| PO5
    TL9 -->|calls| PO3
    TL12 -->|calls| PO8

    PO1 -->|uses util| UH1
    PO2 -->|uses util| UH1
    PO3 -->|uses util| UH2
    PO4 -->|uses util| UH2
    PO5 -->|uses util| UH6
    PO6 -->|uses util| UH6
    PO7 -->|uses util| UH6
    PO8 -->|uses util| UH5
    PO9 -->|uses util| UH5

    PO1 -->|drives| WD
    PO2 -->|drives| WD
    PO3 -->|drives| WD
    PO4 -->|drives| WD
    PO5 -->|drives| WD
    PO6 -->|drives| WD
    PO7 -->|drives| WD
    PO8 -->|drives| WD
    PO9 -->|drives| WD

    WD -->|controls| B

    B -->|test output| RM1
    B -->|test output| RM2
    B -->|test output| RM3
    B -->|test output| RM4
    B -->|test output| RM5
    B -->|test output| RM6
    B -->|logs| LM

    %% Click Events
    click CFG1 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/config.ini"
    click CFG2 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/configuration/config.ini"
    click CFG3 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/config.ini"
    click CFG4 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/configuration/config.ini"
    click CFG5 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/config.ini"
    click CFG6 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/config.ini"

    click DP1 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/excelReader.py"
    click DP2 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Utils/ExcelReader.py"
    click DP3 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/excelReader.py"
    click DP4 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/ExcelData/LoginData.xlsx"
    click DP5 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Utils/LoginDataForOrangeHRM.xlsx"
    click DP6 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/ExcelFiles/loginData.xlsx"

    click TL1 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/Tests/test_search.py"
    click TL2 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/Tests/conftest.py"
    click TL3 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Tests/test_search.py"
    click TL4 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Tests/conftest.py"
    click TL5 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/test_loginSauceDemo.py"
    click TL6 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/conftest.py"
    click TL7 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Tests/test_login.py"
    click TL8 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Tests/conftest.py"
    click TL9 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/test_login.py"
    click TL10 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/test_excelLogin.py"
    click TL11 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/conftest.py"
    click TL12 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/tests/test_Search.py"
    click TL13 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/tests/conftest.py"

    click PO1 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/Pages/HomePage.py"
    click PO2 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/Pages/SearchPage.py"
    click PO3 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Pages/HomePage.py"
    click PO4 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Pages/SearchPage.py"
    click PO5 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Pages/BasePage.py"
    click PO6 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Pages/loginpage.py"
    click PO7 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task2/Pages/dashboardPage.py"
    click PO8 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/pages/HomePage.py"
    click PO9 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/pages/SearchPage.py"

    click UH1 "https://github.com/dhanusheswaranm/python_selenium/blob/main/POM/Utility/read_config.py"
    click UH2 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Utilities/read_config.py"
    click UH3 "https://github.com/dhanusheswaranm/python_selenium/blob/main/pagefactory/Utilities/consolelogger.py"
    click UH4 "https://github.com/dhanusheswaranm/python_selenium/blob/main/fixture/hooksfunctionallevel.py"
    click UH5 "https://github.com/dhanusheswaranm/python_selenium/blob/main/PageObjectModel/utilities/read_config.py"
    click UH6 "https://github.com/dhanusheswaranm/python_selenium/blob/main/Task/read_config.py"
    click UH7 "https://github.com/dhanusheswaranm/python_selenium/blob/main/datadriframe/read_config.py"

    click TR "https://github.com/dhanusheswaranm/python_selenium/tree/main/pytest/"

    %% Styles
    classDef code fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef external fill:#d4edda,stroke:#333,stroke-width:1px
    classDef infra fill:#ffe5cc,stroke:#333,stroke-width:1px
    classDef output fill:#e2d6f7,stroke:#333,stroke-width:1px
```
