Web Automation Practice

Sorting and Filtering a Table

Instructions: Your script should interact with the controls to filter and sort the table data.

  1. Filtering: Type "Fruit" into the filter input box and verify that only rows with "Fruit" in the category are visible.
  2. Sorting: Click the "Product Name" header to sort the table alphabetically. Click it again to sort in reverse.
  3. Sorting (Numeric): Click the "Price" header to sort the table by price.

Validation: Your script should check the row count after filtering and the order of rows after sorting.

Product Name Category Price
Apple Fruit 1.20
Broccoli Vegetable 2.50
Milk Dairy 3.00
Banana Fruit 0.60
Carrot Vegetable 1.00
Cheese Dairy 4.50