Selenium Framework

Robust UI Test Automation

A comprehensive, production-ready test automation framework built with Selenium and Java. Implements Page Object Model pattern, BDD with Cucumber, and enterprise-grade best practices for reliable UI testing.

Project Overview

Scalable Architecture

Built on proven patterns like Page Object Model and Component-Based testing, ensuring maintainability and scalability as your test suite grows.

BDD Framework

Cucumber-driven test scenarios that bridge business requirements and technical implementation, making tests readable for both QA and business stakeholders.

Production Ready

Enterprise-grade utilities including configuration management, screenshot capture, Excel data handling, and comprehensive error logging for production environments.

Technology Stack

Java

Core language for robust, type-safe test automation

Selenium WebDriver

Browser automation and element interaction

Cucumber BDD

Behavior-driven testing with Gherkin syntax

Maven

Build automation and dependency management

Apache POI

Excel data-driven testing support

Framework Architecture

Design Patterns & Structure

  • Page Object Model: Encapsulates page elements and actions in separate classes for better maintainability
  • Component-Based Testing: Reusable UI component abstractions (Button, TextField, Dropdown, etc.)
  • BDD with Cucumber: Feature files describe scenarios in plain language, step definitions implement the logic
  • Configuration Management: Externalized config for environment and driver settings
  • Utility Layer: Centralized utilities for common operations, screenshot capture, and data handling
  • Hooks & Lifecycle: Setup/teardown logic for test initialization and cleanup
Test Layer

Step Definitions & Hooks

Page Layer

Page Objects & Components

Utility Layer

WebDriver, Config, Utils

Application

Web Application Under Test

Key Features

Reusable Components

AppButton, AppLink, AppText, AppTextInput, AppDropDown, AppCart, AppHamburgerMenu - all extending a base Component class for consistent behavior

Multi-Layer Organization

Clear separation between test logic, page objects, components, and utilities ensuring easy navigation and maintenance

Configuration Management

Environment-specific configurations for different browsers, environments, and test data sources via properties files

Data-Driven Testing

Excel file support for parameterized test execution with multiple data sets

Screenshot Capture

Automated screenshot utilities for failure analysis and evidence collection

Scenario Context

ScenarioContext utility for sharing data across step definitions within a test scenario

Test Scenarios

User Login Critical

  • Navigate to login page
  • Enter valid credentials
  • Click login button
  • Verify successful authentication
  • Confirm redirect to inventory page

Product Browsing Functional

  • Access inventory page
  • Verify product list loads
  • Filter/sort products
  • View product details
  • Confirm accurate product information

Add to Cart Functional

  • Select product from inventory
  • Click add to cart button
  • Verify item added to cart
  • Check cart count updates
  • Navigate to cart view

Checkout Process Critical

  • Review items in cart
  • Proceed to checkout
  • Enter shipping information
  • Confirm payment details
  • Complete purchase successfully

Directory Structure

/UITestAutomation/
├── file-tree.txt
├── index.html
├── pom.xml
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── org/example/
│ │ │ ├── application/
│ │ │ │ ├── Selectors/
│ │ │ │ │ └── CommonSelectors.java
│ │ │ │ ├── components/
│ │ │ │ │ ├── AppButton.java
│ │ │ │ │ ├── AppCart.java
│ │ │ │ │ ├── AppDropDown.java
│ │ │ │ │ ├── AppHamburgerMenu.java
│ │ │ │ │ ├── AppLink.java
│ │ │ │ │ ├── AppText.java
│ │ │ │ │ ├── AppTextInput.java
│ │ │ │ │ └── Component.java
│ │ │ │ └── pages/
│ │ │ │ ├── CartPage.java
│ │ │ │ ├── CheckoutPage.java
│ │ │ │ ├── InventoryPage.java
│ │ │ │ └── LoginPage.java
│ │ │ ├── config/
│ │ │ │ └── ConfigReader.java
│ │ │ ├── drivers/
│ │ │ │ └── WebDriverManager.java
│ │ │ ├── enums/
│ │ │ │ ├── DriverType.java
│ │ │ │ └── EnvironmentType.java
│ │ │ └── utilities/
│ │ │ ├── Element.java
│ │ │ ├── ExcelReader.java
│ │ │ ├── PropertyReader.java
│ │ │ ├── ScenarioContext.java
│ │ │ └── ScreenshotUtils.java
│ │ └── resources/
│ │ ├── config.properties
│ │ ├── drivers/
│ │ │ └── chromedriver.exe
│ │ └── testdata.xlsx
│ └── test/
│ ├── java/
│ │ └── org/example/
│ │ ├── features/
│ │ │ └── Tests.feature
│ │ ├── hooks/
│ │ │ └── Hooks.java
│ │ ├── runners/
│ │ │ ├── SmokeTestRunner.java
│ │ │ └── TestRunner.java
│ │ └── stepDefinitions/
│ │ ├── CartPageSteps.java
│ │ ├── CheckoutSteps.java
│ │ ├── CommonSteps.java
│ │ ├── InventoryPageSteps.java
│ │ └── LoginSteps.java
│ └── resources/
│ ├── config.properties
│ └── testdata.xlsx

Project Structure

Page Objects
  • LoginPage
  • InventoryPage
  • CartPage
  • CheckoutPage
  • CommonSelectors
UI Components
  • AppButton
  • AppLink
  • AppText
  • AppTextInput
  • AppDropDown
  • AppCart
  • AppHamburgerMenu
Core Utilities
  • WebDriverManager
  • ConfigReader
  • PropertyReader
  • ExcelReader
  • ScreenshotUtils
  • ScenarioContext
  • Element Utilities
Test Definitions
  • LoginSteps
  • InventoryPageSteps
  • CartPageSteps
  • CheckoutSteps
  • CommonSteps
Configuration
  • config.properties
  • testdata.xlsx
  • DriverType Enum
  • EnvironmentType Enum
Test Runners
  • TestRunner
  • SmokeTestRunner
  • Hooks (Setup/Teardown)
  • Feature Files