- Navigate to https://rahulshettyacademy.com/seleniumPractise/#/ page
- Assert page is opened (url, title)
- Add "Mango" to the cart
- Assert Items and Price are shown as expected in the cart info (top right)
- Click on the cart icon
- Assert "Mango" is shown on the opened overlay
- Click on "Proceed to checkout" button
- Assert cart page is opened
- Asset only one item is shown in the cart
- Click on "Place Order"
- Check "Terms & Conditions" checkbox
- Click on "Proceed" button
- Assert Success message is shown
This is a dynamic automated test using Java Selenium, it asserts the required tasks listed up.
Technology Used: Java, Selenium, Maven, JUnit5
Framework Used: Page Object Model
Required Dependancies: Navigate to mvnrepository.com and search following dependencies, next step by step copy them and paste to your POM.xml file in the dependencies section.
- JUnit Jupiter (Aggregator)
- WebDriverManager (io.github.bonigarcia)
- Selenium Chrome Driver
- Selenium Support
Open TestGreenKart class in test->java->greenKartTests folder then run the @Test or class.
@Test
@DisplayName("Homework task with POM")
public void testHomeworkWithPOM() {
String actualURL = driver.getCurrentUrl();
String actualTitle = driver.getTitle();
assertEquals(MAIN_URL, actualURL);
assertEquals(EXPECTED_TITLE, actualTitle);
.....
}