Selenium WebDriver 4

Find a row by matching text

Medium70 pts~25 min
  • Tables
  • XPath
  • Relative locators
Practice app · People Directory

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

Test URL
/lab/selenium-find-a-row-by-matching-text

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

Objective

Find the employee row by the person's name instead of a fixed position, then assert the other cells of that row.

Your task

  1. 1Find the row whose td.col-name is “Ethan Rossi” (XPath like //tr[td[normalize-space()='Ethan Rossi']] or by filtering rows).
  2. 2From that row, read td.col-department, td.col-salary and td.col-status.
  3. 3Assert department “QA”, salary “$99,000” and status “Remote”.

Acceptance criteria

  • The row is located by its text
  • No hardcoded row index or data-id is used
  • At least 2 assertions pass

Constraints

  • Do not hardcode the row position (index 6 or data-id="6").

Selenium WebDriver 4 · Selenium · Tables & dynamic content