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 website is used for Task 1 and Task 2.
-
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.
-
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 repository 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. Task 3, Task 4 and Task 5 was done using that 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.
- The tests are implemented using TestNG framework in the
TestNG For From Submission Page Checkfolder. - Test cases for form submission functionalities are located in
TestNgForFormSubmissionCheck. - TestNG reports are automatically generated in the
test-outputdirectory.
- The tests are implemented using JUnit framework in the
JUnit For From Submission Page Checkfolder. - Test cases for form submission functionalities are located in
JunitPracticeForFormPage.java.
- Selenium WebDriver: Automation tool for web browsers.
- Java: Programming language used for scripting.
- TestNG: Framework for organizing test cases (Task 4).
- JUnit: Framework for organizing test cases (Task 5).
- 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
/driversdirectory.
- 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,SeleniumAssignmentTwo.java,PracticeThree.javaTestNgForFormSubmissionCheckandJunitPracticeForFormPage.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.