Skip to content

Fatema37/WEB-AUTOMATION-ASSIGNMENT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flipkart Test Automation using TestNG

This project contains TestNG test suites for automating certain functionalities of Flipkart.com. It includes tests for validating Sort Functionality and the Add to Cart functionality.

Project Files

  • SortProducts.java: Contains the test cases for validating the Product Sorting functionality.
  • AddToCart.java: Contains the test cases for validating the Add to Cart functionality.
  • test_data.xlsx: Stores test data like search terms, sort options, and number of pages.

Test Cases

1. Validate Product Sort Functionality

This test case validates that products are displayed in the correct order after applying a sort filter (e.g., "Price - Low to High").

  • Steps:
    1. Open Flipkart.com.
    2. Search for a product (e.g., "shoes").
    3. Apply a sort filter (e.g., "Price - Low to High").
    4. Validate that the prices of the displayed products (up to a specified page limit) are in ascending order.

2. Validate Add to Cart Functionality

This test case validates the process of adding products to the cart and verifying the cart contents.

  • Steps:
    1. Open Flipkart.com.
    2. Search for a product.
    3. Apply a sort filter.
    4. Click on 2nd product and add to cart, then click on 3rd product and add to cart
    5. Verify that the correct products and prices are displayed in the cart.
    6. Verify the total price in the cart.

Data Sources

  • test_data.xlsx: Contains basic test data like search keywords, sortByParam and page.

Time Spent

Approximately 8 hours were spent on developing these test suites, including:

  1. Setting up the project and environment.
  2. Writing the test cases (including handling multiple windows and dynamic content).
  3. Implementing data-driven testing using properties files and Excel.
  4. Debugging and resolving issues with window handling and element locators.
  5. Writing the ReadXlsData utility class.
  6. Creating the testng.xml configuration.
  7. Documenting the project in this README.

How to Run the Tests

Prerequisites:

  1. Java Development Kit (JDK) 8 or higher
  2. Maven
  3. A suitable IDE (IntelliJ IDEA, Eclipse, etc.) is recommended.
  4. Chrome browser installed.

Project Setup:

  1. Clone the project repository.
  2. Import the project into your IDE as a Maven project.

Running Tests via testng.xml:

  1. Locate the testng.xml file in the project root.
  2. Right-click on the testng.xml file in your IDE.
  3. Select "Run As" -> "TestNG Suite."

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages