Selenium WebDriver 4

Sort a table and verify order

Hard120 pts~45 min
  • Tables
  • Sorting
  • Collections
Practice app · People Directory

A sortable, filterable, paginated employee table and a live counter.

Test URL
/lab/selenium-sort-a-table-and-verify-order

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Sort the directory by name in both directions and prove the visible order is correct.

Your task

  1. 1Click #sort-name once, collect the td.col-name texts of the page and assert they equal a sorted copy (first “Abigail Hughes”).
  2. 2Click #sort-name again and assert the names are in descending order (first “Zoe Fischer”).
  3. 3Compare against a copy you sort in code — do not hardcode the whole expected list.

Acceptance criteria

  • Order is verified by comparing with a sorted copy
  • The table ends sorted descending with “Zoe Fischer” first
  • At least 2 assertions pass

Selenium WebDriver 4 · Selenium · Tables & dynamic content