WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

A Selenium-based automation framework for testing an ecommerce website, built with Java, TestNG, and Maven. It follows the Page Object Model (POM) design pattern and includes ExtentReports with screenshots. Features runtime browser selection, external configuration, and modular, scalable test structure ideal for real-world QA environments.

Notifications You must be signed in to change notification settings

Anikdell/Ecommerce-website-automation

Repository files navigation

Java TestNG Selenium Maven License

Automation Test Framework

Author: Anik Mitra
Email: [email protected]

Overview

This project is a Selenium-based Test Automation Framework built using Java and TestNG. It includes runtime browser selection, ExtentReports integration, element highlighting, and automatic screenshot capture during test execution.


Features

  • Browser Selection Prompt: Choose Chrome or Edge at runtime via terminal.
  • Selenium WebDriver Integration using WebDriverManager.
  • TestNG Framework for test management.
  • ExtentReports with step logging and embedded screenshots.
  • Dynamic Element Highlighting with red border and yellow background.
  • Configurable properties via config.properties.

Setup Instructions

1. Prerequisites

  • Java JDK 8 or above
  • Maven
  • Internet connection (for WebDriverManager to download browser drivers)

2. Clone or Extract the Project

Extract the provided ZIP file.

3. Open the Project

Use any Java IDE (e.g., IntelliJ, Eclipse) or a code editor.

4. Run Tests

Run the test via TestNG. When prompted in the terminal, input your browser choice:

Choose browser (chrome/edge):

5. View Results

  • Extent Report: Located at test-output/ExtentReport.html
  • Screenshots: Captured per step in test-output/screenshots/

Project Structure

automationtest/
├── pom.xml
├── src/
│   ├── main/
│   │   └── java/
│   │       └── utils/
│   │           └── DriverUtil.java
│   └── test/
│       └── java/
│           └── tests/
│               ├── AutomationTest.java
│               └── config.properties
├── test-output/
│   ├── ExtentReport.html
│   └── screenshots/

Custom Logic

Browser Prompt (DriverUtil.java)

Scanner scanner = new Scanner(System.in);
System.out.println("Choose browser (chrome/edge): ");
String browser = scanner.nextLine().trim().toLowerCase();

Element Highlighting

js.executeScript("arguments[0].style.border='3px solid red'; arguments[0].style.background='yellow'", element);

Screenshot Capture

TakesScreenshot ts = (TakesScreenshot) driver;
File source = ts.getScreenshotAs(OutputType.FILE);

Logging to ExtentReports

test.log(Status.INFO, "Action Description").addScreenCaptureFromPath(screenshotPath);

Author

About

A Selenium-based automation framework for testing an ecommerce website, built with Java, TestNG, and Maven. It follows the Page Object Model (POM) design pattern and includes ExtentReports with screenshots. Features runtime browser selection, external configuration, and modular, scalable test structure ideal for real-world QA environments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published