This project demonstrates a basic automation testing scenario using Selenium and TestNG. The goal is to automate key interactions on the Amazon.co.uk website, such as launching the site, accepting cookies, searching for products, adding products to the cart, and more.
- Launch Amazon.co.uk using Firefox WebDriver.
- Accept cookies to enable seamless navigation.
- Search for products (e.g., "speakers") using the search bar.
- Select a product from the search results.
- Add the selected product to the cart.
- Simulate removing the product from the cart.
- Navigate back to the Amazon homepage.
- Clone this repository to your local machine.
- Make sure you have Firefox installed on your machine.
- Download the appropriate
geckodriver
executable and set the path in theamazonLaunch()
method. - Update the path to your Firefox binary in the
amazonLaunch()
method. - Open the project in your preferred Java IDE.
- Run the
SeleniumTest
class to execute the test.
- Selenium WebDriver
- TestNG
- Firefox browser
- GeckoDriver
- Run the
SeleniumTest
class to perform the automated tests on Amazon.co.uk. - Observe the interactions and verifications in the console output.
- The browser window will close automatically after the tests complete.
This project serves as a learning exercise to practice automation testing with Selenium. Feel free to explore and contribute improvements or additional scenarios.
- Implement more test cases to cover a broader range of scenarios.
- Enhance error handling and reporting mechanisms.
- Explore integration with other browsers and headless testing.
This project is for educational and learning purposes only. It is not intended for use in production environments. Use responsibly and follow Amazon's terms of service.