DWQA Ask QuestionCategory: SeleniumE commerce Real Time Scenario: Search and View Cart Validation
admin Staff asked 5 years ago

URL: Any E Commerce. Use demo site: https://demo.cs-cart.com/

  1. Create an Excel file with the Product IDs and their quantities.
  2. Create a Test Case to Search and add a single product in to the Add to Cart.
  3. Put validation as well that product has been added.
  4. After all the products have been added, go to the View Cart page and Validate:
    1. All the products in the Excel are added.
    2. Products quantities matches with what was sent from excel
    3. Price of the products are correctly displayed.
    4. Total prices of the cart matches after addition on all the price and quantity.

use: Maven, TestNG, data provider, test ng priority

Hint:

  • Excel file with Product code and first column and quantity in second column.
  • Create a @Test test and write code to search and add a single product.
  • This test case should take values from Data Provider.
  • Create a data provider and fetch data from Excel in side this method.
  • So first test method will only be used to fetch the data and search and add to cart.
  • For validation, create another method and call this method after the first method using test ng priority.

So something like below:

  • @Test(dataProvider=”dp”, priority=0) // this will run first
    • t_search_and_add_to_cart(String product)
    • //Code to search and add to cart
  • @Test(priority=1) // this will execute after all the products are added
    • t_validate_the_view_cart()

 

1 Answers
swanson4 Staff answered 2 years ago

Situs judi online yang terpercaya pasti akan memberikan pelayanan yang terbaik, tujuan mereka pasti ingin membuat para member semakin betah. Maka mereka akan memberikan kulitas permainan yang terbaik. Mereka menyediakan berbagai macam permainan Pragmatic Slot yang begitu sangat menarik dan sangat seru .