Skip to main content

Getting Started Selenium with Java

A sample automation framework demonstrating the use of Selenium WebDriver with the Page Object Model (POM) design pattern and Allure reporting integration.

Features

  • Selenium WebDriver: Automate browser actions for web application testing.
  • Page Object Model (POM): Organize test code by separating page structure and test logic for better maintainability.
  • Allure Reporting: Generate visually rich test reports.
  • TestNG/JUnit Integration: Easily run tests and manage test suites.

Prerequisites

  • Java (8 or above)
  • Maven or Gradle
  • ChromeDriver/GeckoDriver (for Chrome/Firefox automation)
  • Allure CLI

Project Structure

src/
main/
java/
pages/ # Page Object classes
utils/ # Utility classes
test/
java/
tests/ # Test classes
pom.xml / build.gradle # Build configuration
  1. Run Tests
    mvn clean test
  2. Generate Allure Report
    mvn allure:report  
  3. To see results
    python3 -m http.server 9999 --directory target/

  4. click on popup showing on below right side of IDE

Customization

  • Add more Page Object classes under pages/ as your application grows.
  • Write new tests in tests/ using TestNG or JUnit.
  • Configure driver/browser options in utility classes.
  • Customize Allure configuration as needed.