This repository contains automated tests for a web application using Selenium WebDriver with Java. The tests are designed to perform basic checks on the login functionality and shopping cart operations of the application.
This project Selenium Practice 1 assumes testing on the SauceDemo website. Adjust test scenarios and assertions as per your testing requirements.
-
Login Page Check using ID Locator:
- Locate and verify elements on the login page using ID locators.
-
Verify Website Title:
- Print the current title of the website using an ID locator.
- Assert that the actual title matches the expected title.
-
Verify Current URL:
- Check the current URL of the page after login.
- Assert that the current URL matches the expected URL.
This project Selenium Practice 2 assumes testing on the SauceDemo website. Adjust test scenarios and assertions as per your testing requirements.
-
Navigate to T-Shirt Product Page:
- Click on the orange "T-shirt link" using a absolute path.
-
Add Item to Cart:
- Click on the "Add to Cart" button to add the item to the shopping cart using a relative path.
-
View Shopping Cart:
- Click on the shopping cart badge to view the items in the cart using an absolute path.
-
Continue Shopping:
- Click on the "Continue shopping" button to return to the previous page using an relative path.
This folder SeleniumPracticeThree contains automated tests for a web application using Selenium WebDriver with Java. The tests are designed to perform various form submission checks on the application hosted at Try Testing This Website.
-
Fill First Name and Last Name:
- Locate and fill the First Name and Last Name fields using ID locators.
-
Check Radio Button Selection:
- Verify and assert that the radio button is selected correctly using
isSelected()
method.
- Verify and assert that the radio button is selected correctly using
-
Verify Drop Down Selection:
- Locate the Drop Down element using name locator.
- Verify the selected option from the Drop Down using
isSelected()
method and assert.
-
Check Multiple Options:
- Select multiple options from a list and verify the selections using
isSelected()
method.
- Select multiple options from a list and verify the selections using
-
Submit the Form:
- Click on the Submit button using an absolute path.
-
Confirmation Message:
- Print a confirmation message if the form submission is successful.
- Selenium WebDriver: Automation tool for web browsers.
- Java: Programming language used for scripting.
- TestNG or JUnit: Frameworks for organizing test cases.
- Assertions: Used to validate expected outcomes.
-
Clone the Repository: https://github.com/ZobayerAkib/Selenium_Practice.git
-
Install Dependencies:
- Ensure you have Java Development Kit (JDK) installed.
- Use Maven or Gradle for managing dependencies.
- Configure WebDriver:
- Download the appropriate WebDriver executable (ChromeDriver, GeckoDriver, etc.) and place it in the
/drivers
directory.
- Run Tests:
- Use Maven or Gradle to run the tests, or directly execute the test classes using your IDE.
- Review Test Results:
- After running the tests, review the console output for test results and any assertions that failed.
- Update the expected titles and URLs in the test scripts (
TestSeleniumOne.java
andSeleniumAssignmentTwo.java
) according to your application's actual titles and URLs. - Ensure all paths (relative and absolute) in the test scripts are correct and match your application's structure.
- Use appropriate annotations and assertions provided by TestNG or JUnit to structure your test cases effectively.