How hamzaahmed288/framework works
Project Type and Purpose
• This is a Java‐based automated testing framework (not a customer‐facing app).
• It uses Maven for build management, TestNG for orchestration, Selenium WebDriver for browser automation, and the Page Object Model (POM) for organizing UI interactions.
File Structure
Top‐level directories:
• Config – holds Config.properties (environment settings, URLs, credentials).
• Drivers – WebDriver executables (e.g., chromedriver).
• HD-Screenshots – folder for screenshots captured on test failures or checkpoints.
• HD-Test Data – external Excel/.numbers spreadsheet with test data.
• XML Files – testng.xml (defines test suites, groups, parameters).
• src/test/java – code organized into three packages:
– pages: Page Object classes (LoginPage, BaseClass)
– testcases: Test classes (HD_LOGIN_Test)
– utility: helpers and providers (BrowserFactory, ConfigDataProvider, ExcelDataProvider, Helper)
• test-output – generated TestNG and JUnit reports (HTML, XML), logs, screenshots.
README
• Confirms it’s an “Automation Framework.” No additional architectural notes.
Main Components & Responsibilities
a. Test Runner / Orchestrator
– TestNG (configured via testng.xml) triggers Test Cases.
– Maven Surefire plugin executes tests.
b. Test Cases
– Implement test scenarios by invoking Page Objects and Utilities.
c. Page Objects (POM)
– Encapsulate UI element locators and actions (e.g., LoginPage).
d. Utilities
– BrowserFactory: initializes WebDriver instances using Drivers folder.
– ConfigDataProvider: reads Config.properties.
– ExcelDataProvider: reads HD-Test Data.
– Helper: screenshots, waits, common operations.
e. External Resources
– Config.properties, Excel files, testng.xml, WebDriver executables.
f. Reporting & Artifacts
– test-output: HTML/XML reports, screenshots.
Relationships & Data Flows
1. Maven invokes TestNG (testng.xml).
2. TestNG loads Config & Data Providers.
3. BrowserFactory reads the WebDriver binary (Drivers) → starts browser.
4. Test Cases call Page Objects → drive UI via WebDriver.
5. On assertions/failures, Helper captures screenshots (HD-Screenshots).
6. TestNG produces reports under test-output.
Architectural Patterns & Principles
• Page Object Model for UI abstraction (improves maintainability).
• Dependency Injection via utility providers (Config, Data, Browser).
• Externalize data/config (properties file, Excel, XML).
• Separation of concerns: test logic vs. page interactions vs. utilities.