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.
- 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
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
- Java JDK 8+
- Maven
- Internet connection
- LambdaTest credentials
- 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)
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.
- Clone the repo
git clone https://github.com/yourusername/amazon-search-automation.git cd amazon-search-automation
-
Update LambdaTest credentials
-
Run with Maven
mvn clean testDefined in pom.xml:
Selenium Java
TestNG
WebDriverManager (optional for local runs)
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.