Untitled

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Assignment Title: Web Automation with TestNG Assertions

Objective: The objective of this assignment is to practice web automation using Selenium
WebDriver in Java along with TestNG assertions to verify the correctness of web application
behavior.

Scenario: Imagine you are testing a simple e-commerce website where users can search for
products and view product details. You want to ensure that the website functions correctly. (Use
Flip kart Website)

Assignment Tasks:

1. Setup:
o Set up a Java project with TestNG for your test suite.
o Download and configure the Selenium WebDriver for Java.
2. Test Cases:
o Create two test cases:

Test Case 1: Product Reviews

 Navigate to a product details page by clicking on a product from the search results.

 Verify that the product details are displayed correctly (e.g., product name, price,
description).
 Scroll down to the product's customer reviews section.
 Click on the "Read Reviews" button or link to view customer reviews.
 Verify that customer reviews are displayed.
 Select one of the customer reviews and read its content.
 Assert that the content of the selected review matches the expected content.

Test Case 2: Product Details

 Navigate to a product details page by clicking on a product from the search results.
 Verify that the product details are displayed correctly (e.g., product name, price,
description).

Assertions:
For each test case , use TestNG assertions to verify the correctness of the web application
behavior.
For example:

1. test case 1 focuses on verifying the display and functionality of customer reviews for a
product on the e-commerce website.
2. You can use TestNG assertions to check if the reviews are displayed and if the content
matches expectations.
3. In "Product Details," assert that the displayed product name matches the expected
product name.

1. Test Execution:
o Execute the test suite and observe the results.
2. Reporting:
o Create a simple test report summarizing the test results, including the number of
passed and failed tests.

Submission:

 Share your Java project, including the TestNG test classes, Selenium WebDriver setup,
and the test report.

You might also like