How sumit5426/selenium-java-test-automation-framework works
Project Type and Purpose
• This is an open-source Selenium-Java Test Automation Framework, a hybrid framework combining data-driven and modular approaches.
• Its purpose is to provide a scalable, maintainable test-automation solution with support for multiple data formats, parallel and headless execution, cloud integration (LambdaTest), rich reporting (Extent Reports), and CI/CD via GitHub Actions.
File Structure
• Top-level files/config:
• pom.xml (Maven build & Surefire configuration)
• config/ (DEV, QA, UAT .properties + config.json)
• TestData/ (Excel, JSON, CSV)
• .github/workflows/maven.yml (CI pipeline)
• testng.xml (TestNG suite definition)
• reports.html, test-output/ (local reports)
• src/test/java:
• pages/ → Page Object Model (POM) classes
• uipopjo/ → POJO models for test-data
• uidataprovider/ → TestNG data providers
• uilistener/ → TestNG listeners & retry analyzer
• uiutility/ → Utilities (CSVReader, ExcelReader, JsonUtility, LoggerUtility, ExtentReportUtility, BrowserUtility, Faker utility, LambdaTest utility, PropertiesUtil)
• uitest/ → Test classes (TestBase, LoginTest, AddNewAddressTest, ProductCheckOut, SearchProductTest, etc.)
• src/test/resources:
• log4j2.xml (logging configuration)
README for Additional Insights
• Framework features: POM, Singleton pattern, POJO, data-driven via Excel/CSV/JSON/Properties, Faker for fake data.
• Execution flags: isHeadless, isLambdaTest, environment, browserName.
• Cloud integration: LambdaTest.
• Reporting: Extent Reports, Log4j.
• CI: GitHub Actions scheduled nightly, reports published to gh-pages.
a. Main Components
1. Test Runner (TestNG + Maven Surefire)
2. Test Suite (testng.xml, uitest package)
3. Test Base & Browser Utility (initializes WebDriver, manages headless/cloud execution)
4. Page Objects (pages package)
5. Data Layer
– Data Providers (uidataprovider)
– Test Data stores (Excel, CSV, JSON, Properties)
– POJO Models (uipopjo)
6. Utility Layer (uiutility)
– CSV/Excel/JSON Readers
– LoggerUtility (Log4j)
– ExtentReportUtility (reports)
– FakerAddressUtility
– LambdaTestUtility
– PropertiesUtil
7. Listeners & Retry Analyzer (uilisteners)
8. External Services
– LambdaTest Cloud
– GitHub Actions (CI/CD)
– gh-pages (report hosting)
b. Relationships & Interactions
• TestNG Suite invokes TestBase, passing runtime parameters (browserName, environment, isHeadless, isLambdaTest).
• TestBase calls BrowserUtility → starts local or LambdaTest WebDriver instance.
• Test Classes request test data from Data Providers, which load from JSON/Excel/CSV/Properties via Utility Layer, mapping into POJOs.
• Test Classes use Page Objects to interact with the AUT (Application Under Test).
• Listeners hook into TestNG lifecycle to capture failures, take screenshots, trigger retries.
• Utilities log test steps (Log4j) and build report entries (Extent Reports).
• Maven packages & runs tests; outputs go into test-output/ and reports.html.
• GitHub Actions triggers mvn test nightly, collects reports, publishes to gh-pages.
c. Architectural Patterns & Principles
• Page Object Model (POM) for UI abstraction.
• Singleton pattern for WebDriver & configuration instances.
• Data-Driven via TestNG data providers + POJOs.
• Modular separation: test logic, page objects, data, utilities, configuration.
• Dependency Inversion: Tests depend on interfaces/utilities rather than concrete readers.
d. Key Technologies/Frameworks
• Java 17, Maven, TestNG, Selenium WebDriver
• Apache POI (Excel), OpenCSV, Gson (JSON)
• Faker, LambdaTest SDK, Log4j2, Extent Reports
• GitHub Actions for CI/CD