This project contains automated test cases for the following functionalities on Amazon.in:
- Sign Up
- Sign In
- Add to Cart
- Place an Order
These test cases are written in Java using Selenium WebDriver, allowing for efficient testing of web applications.
Before you begin, ensure you have the following installed:
- Java Development Kit (JDK)
- Apache Maven (for managing dependencies)
- Chrome WebDriver (ensure it matches your Chrome browser version)
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Install dependencies: If you are using Maven, add the following dependencies in your
pom.xml
:<dependencies> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.x.x</version> <!-- Replace with the latest version --> </dependency> <!-- Add other dependencies as needed --> </dependencies>
-
Set up the WebDriver: Ensure the ChromeDriver is in your system's PATH or specify its path in the test code.
- Objective: Test the user registration process.
- Steps:
- Navigate to the sign-up page.
- Fill in the required information (name, email, password, etc.).
- Submit the registration form.
- Objective: Test the user login process.
- Steps:
- Navigate to the Home page.
- Click on Sign In
- Enter registered email.
- Click on continue
- Enter password.
- Click the sign-in button.
- Verify successful login.
- Objective: Test adding a product to the cart.
- Steps:
- Search for a product.
- Click on the product to view details.
- Click the "Add to Cart" button.
- Objective: Test the order placement process.
- Steps:
- Go to the cart.
- Click on the "Proceed to Checkout" button.
- Select the necessary payment and shipping details.
- Submit the order.
- Verify order confirmation.
You can run the tests using your IDE or by executing the Maven command:
mvn test