Skip to content

πŸ” Automates Amazon.com product search and add-to-cart functionality using Selenium WebDriver, TestNG, and Page Object Model on the LambdaTest cloud grid. Built in Java with remote execution on macOS + Chrome.

License

Notifications You must be signed in to change notification settings

RaghavK16/AmazonAutomation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AmazonAutomation

This project is a simple UI automation framework built using Java, Selenium WebDriver, TestNG, and Page Object Model (POM) design pattern. It runs on the LambdaTest Selenium Grid to execute tests on macOS environments with Chrome browser.

πŸ”§ Features

  • Test Amazon.com search and add-to-cart functionality
  • Execute on remote browser (Chrome/macOS Sequoia) using LambdaTest
  • Modular Page Object Model structure
  • Handles dynamic waits using WebDriverWait
  • Robust error handling and locator separation

πŸ—‚οΈ Project Structure

amazon-search-automation/ β”‚ β”œβ”€β”€ src/ β”‚ └── main/ β”‚ └── java/ β”‚ └── amazon/ β”‚ β”œβ”€β”€ AmazonSearchTest.java # Test class β”‚ └── pages/ β”‚ └── AmazonPageLocators.java # All locators used β”‚ β”œβ”€β”€ testng.xml # TestNG suite β”œβ”€β”€ pom.xml # Maven dependencies └── README.md


βœ… Prerequisites

  • Java JDK 8+
  • Maven
  • Internet connection
  • LambdaTest credentials

πŸ§ͺ Test Scenarios

  • Search for a product (e.g., iPhone or Galaxy)
  • Click the first product from the search results
  • Add the product to cart
  • Capture and display the product price (if available)

πŸ”‘ LambdaTest Configuration

Make sure to replace these in AmazonSearchTest.java:

String username = "YOUR_LT_USERNAME";
String accessKey = "YOUR_LT_ACCESS_KEY";

You can find these in your LambdaTest profile.

πŸš€ How to Run

  1. Clone the repo

git clone https://github.com/yourusername/amazon-search-automation.git cd amazon-search-automation

  1. Update LambdaTest credentials

  2. Run with Maven

mvn clean test

🧱 Dependencies

Defined in pom.xml:

Selenium Java

TestNG

WebDriverManager (optional for local runs)

πŸ“Œ Notes

This test runs entirely on LambdaTest's cloud platform.

Elements like cookie banners and price locators are handled using fallback strategies.

Make sure the browser version/platform specified in capabilities is available on LambdaTest.

About

πŸ” Automates Amazon.com product search and add-to-cart functionality using Selenium WebDriver, TestNG, and Page Object Model on the LambdaTest cloud grid. Built in Java with remote execution on macOS + Chrome.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages