How mukesh-50/seleniumframeworkjanbatch2025 works
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)