Skip to content

vidya169/amazon-selenium-framework1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon & SauceDemo Selenium Automation Framework

Overview

This project is a Selenium 4 automation framework built using Java, Maven, and TestNG, following the Page Object Model (POM) design pattern.

The purpose of this framework is to demonstrate:

  • Clean automation architecture
  • End-to-end test design
  • Stable suite execution
  • Real-world automation decision making

The framework is validated using:

  • SauceDemo (stable demo application – guaranteed pass)
  • Amazon (used only to discuss real-world automation constraints)

Tech Stack

  • Java 11
  • Selenium WebDriver 4
  • TestNG
  • Maven
  • WebDriverManager
  • Chrome (Incognito mode for stability)
  • Eclipse IDE

Project Structure

amazon-selenium-framework │ ├── pom.xml ├── testng.xml ├── README.md ├── screenshots │ └── src ├── main │ └── java │ └── com.amazon.automation │ ├── base │ │ └── BaseTest.java │ ├── pages │ │ ├── LoginPage.java │ │ ├── ProductsPage.java │ │ ├── CartPage.java │ │ └── MenuPage.java │ └── utils │ ├── DriverFactory.java │ └── ScreenshotUtil.java │ └── test └── java └── com.amazon.automation.tests └── SauceDemoE2ETest.java

Automated End-to-End Flow (SauceDemo)

Scenario: Complete User Journey

  1. Launch application
  2. Login with valid credentials
  3. Verify products page
  4. Add product to cart
  5. Verify cart contents
  6. Logout
  7. Verify user is returned to login page

This represents a true end-to-end flow, covering both functional validation and session handling.


Why SauceDemo Is Used

SauceDemo is a demo application specifically designed for automation testing:

  • No captcha or OTP
  • Stable DOM
  • Predictable behavior
  • Widely accepted in interviews

This ensures:

  • Reliable execution
  • Consistent green test runs
  • Focus on framework quality rather than site restrictions

Amazon Automation (Design Discussion Only)

Amazon was explored to understand real-world challenges such as:

  • Captcha and bot detection
  • Dynamic UI rendering
  • Browser security popups
  • Delivery and checkout constraints

Production e-commerce sites are not test environments.
This framework intentionally avoids automating checkout on live systems.

Amazon is used only for explanation and discussion, not as a passing E2E demo.


Test Execution

Run Using TestNG Suite

  1. Right-click testng.xml
  2. Select Run As → TestNG Suite

Test Groups

  • smoke – critical E2E flow
  • regression – extended coverage

Execution is controlled via testng.xml, similar to real CI pipelines.


Failure Handling

  • Screenshots are automatically captured on test failure
  • Screenshots are stored in the /screenshots folder
  • Useful for debugging and CI analysis

Browser Stability Handling

To avoid browser-level interruptions:

  • Chrome is launched in incognito mode
  • Password manager and security popups are disabled using ChromeOptions

This reflects real-world automation best practices.


Key Automation Concepts Demonstrated

  • Page Object Model (POM)
  • Explicit waits (WebDriverWait)
  • TestNG suite & group execution
  • Screenshot capture on failure
  • Browser configuration via ChromeOptions
  • End-to-end test design

Interview Talking Points

  • Why POM was chosen
  • Difference between test class vs suite execution
  • Handling browser-level popups
  • Why checkout is excluded on production sites
  • How this framework can scale in CI/CD

Disclaimer

This project is for learning and interview demonstration purposes only.
It does not attempt to bypass or violate any website security mechanisms.


Author

Vidya Prabhakar Chavan
QA Automation Engineer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published