Skip to content

This is a Selenium Java Test Automation Framework using TestNG, Maven, and ExtentReports, built with the Page Object Model design pattern. It provides cross-browser testing, reusable utilities, rich HTML reports, and screenshot capture on failures.

Notifications You must be signed in to change notification settings

FatimaZafar153/Selenium_Java_FrameWork_TutorialProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Selenium Test Automation Framework

A modular, maintainable, and scalable Selenium Test Automation Framework built with Java, TestNG, Maven, Page Object Model (POM), and ExtentReports.

This framework is designed to provide organized test execution, reusability, professional reporting, and cross-browser support while keeping the codebase clean and easy to maintain.


✨ Features

  • TestNG Integration → test execution, grouping, and lifecycle management
  • Maven Dependency Management → auto-manages Selenium, TestNG, WebDriverManager, ExtentReports
  • Page Object Model (POM) → separation of locators, actions, and tests
  • Reusable Utilities → element fetcher, retry analyzer, listeners, constants
  • Cross-Browser Support → Chrome, Firefox, Edge (via WebDriverManager)
  • Extent Reports → detailed HTML reports with pass/fail/skip logs and screenshots
  • Retry & Screenshot Handling → flaky test handling and automatic evidence capture

📂 Project Structure

. ├── base │ └── BaseTest.java # Core test setup (browser, reporting, lifecycle) │ ├── pageObjects │ ├── HomePageElements.java │ └── LoginPageElements.java │ ├── pageEvents │ ├── HomePageEvents.java │ └── LoginPageEvents.java │ ├── qa.tests │ └── Testcase1.java # Sample test using framework │ ├── utils │ ├── Constants.java │ ├── ElementFetch.java │ ├── RetryAnalyzer.java │ └── SuiteListener.java │ ├── pom.xml # Maven dependencies └── testng.xml # TestNG configuration


🔄 Test Execution Flow

  1. Run tests via testng.xml
    • Defines test cases, browsers, and listeners
  2. BaseTest initializes
    • Browser setup, app launch, waits, and reporting configuration
  3. Tests run
    • Page Events trigger actions (clicks, inputs) using Page Objects (locators)
  4. After-method handling
    • Pass/Fail/Skip logged in Extent Report
    • Failures → Screenshot captured + test retried (via RetryAnalyzer & SuiteListener)
  5. Report generated
    • Interactive Extent Report with results & screenshots

🎯 Advantages

  • 📌 Separation of Concerns → Elements (pageObjects), Actions (pageEvents), Tests (qa.tests)
  • 📌 Maintainability → Update locators in one place
  • 📌 Reusability → Utilities for common operations
  • 📌 Scalability → Add tests/pages easily
  • 📌 Professional Reporting → ExtentReports + failure screenshots

▶️ Getting Started

🔹 Prerequisites

  • Java 11+
  • Maven 3+
  • IDE (IntelliJ / Eclipse recommended)

🔹 Installation & Setup

  1. Clone the repository:
    git clone https://github.com/your-username/selenium-framework.git

Import the project as a Maven Project in your IDE.

Run tests using Maven:

mvn clean test or specify the suite:

mvn test -DsuiteXmlFile=testng.xml 🔹 Reports After execution, reports will be available under:

/test-output/ExtentReports 📊 Sample Report The framework generates interactive HTML Extent Reports that include:

Test case execution details

Pass/Fail/Skip logs

Screenshots for failed steps

🛠️ Tech Stack Java

Selenium WebDriver

TestNG

Maven

ExtentReports

WebDriverManager

✅ In One Line A professional Selenium Test Automation Framework with TestNG, Maven, POM, ExtentReports, retries, and screenshots — built for maintainability, scalability, and reliability.

About

This is a Selenium Java Test Automation Framework using TestNG, Maven, and ExtentReports, built with the Page Object Model design pattern. It provides cross-browser testing, reusable utilities, rich HTML reports, and screenshot capture on failures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published