Skip to content

Amar09-source/Selenium_Ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Test Automation Framework

Selenium TestNG Java

A robust test automation framework for e-commerce applications using Selenium WebDriver, TestNG, and Java with Page Object Model design pattern.

Demo Video : https://github.com/user-attachments/assets/ed38ad5d-d411-4e81-99f3-7a936a470ad5

Features

  • Page Object Model implementation for maintainable test code
  • Data-Driven Testing with JSON data files
  • TestNG integration for test execution and reporting
  • Error Handling with dedicated validation tests
  • Cross-Browser support (configurable)
  • Screenshot capability for test failures
  • Grouping Tests for selective execution
  • Dependent Tests for order verification

Framework Structure

e-commerce-test-framework/
├── src/
│   ├── main/
│   │   └── java/
│   │       ├── abstractComponents/
│   │       │   └── AbstractComponent.java
│   │       ├── pageObjects/
│   │       │   ├── CartPage.java
│   │       │   ├── LandingPage.java
│   │       │   ├── OrderPage.java
│   │       │   ├── PlaceOrderPage.java
│   │       │   ├── ProductCatalogue.java
│   │       │   └── SubmitPage.java
│   │       └── testComponents/
│   │           └── BaseTest.java
│   └── test/
│       ├── java/
│       │   ├── testData/
│       │   │   └── DataReader.java
│       │   └── tests/
│       │       ├── ErrorValidationsTest.java
│       │       ├── StandAloneTest.java
│       │       └── SubmitOrderTest.java
│       └── resources/
│           ├── testData/
│           │   └── purchaseOrder.json
│           └── config/
│               ├── globalData.properties
│               ├── errorHandling.xml
│               ├── purchcase.xml
│               └── testng.xml
├── target/
├── pom.xml
└── README.md

Prerequisites

  • Java JDK 8+
  • 🧰 Maven 3.6.3+
  • 🌐 Chrome/Firefox (latest version)
  • ⚙️ Selenium WebDriver 4.0.0+
  • 🧪 **TestNG 7.4.

Installation

  1. Clone the repository:
    git clone https://github.com/ibrahim3rafa/E-commerce-Application-Demo.git
    
    

Configuration

Update globalData.properties with your browser preferences:

properties

browser=chrome

Test Data

[
{
"mail": "your-email@example.com",
"pass": "your-password",
"productName": "PRODUCT_NAME"
}
]

Test Cases

Login Error Validation - Verifies incorrect login scenarios

Product Validation - Checks product presence in cart

Order Submission - Complete purchase flow

Order Verification - Confirms order appears in history

Key Components

  • baseTest.java: Base class with setup/teardown and utilities

  • abstractComponent.java: Reusable WebDriver methods

  • Page Objects: Represent application pages and elements

  • Data Providers: Supply test data from JSON files

Best Practices

  • Follows Page Object Model pattern

  • Uses explicit waits for element interactions

  • Implements clean separation of test code and page logic

  • Supports parallel test execution

  • Includes screenshot capability for debugging

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Selenium_Ecommerce

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published