JS Testing Academy · QA Demo Site

Web Tables

A table with add, edit, delete, search and pagination – the closest thing to a real application screen.

First NameLast NameEmail AgeDepartmentAction

Practice tasks

  1. Count the rows on page 1 and assert it matches the rows-per-page value.
  2. Add a new record and assert it appears in the table.
  3. Search for a name and assert that only matching rows are shown; search for zzz and assert No rows found appears.
  4. Edit a record's department and assert the cell shows the new value.
  5. Delete a record and assert the row count drops by one.
  6. Click a column header to sort, then assert the first row changed.
  7. Switch to 5 rows per page and assert pagination moves to 2 pages.
Sample automation code
List<WebElement> rows = driver.findElements(By.cssSelector("#records-body tr"));
Assert.assertEquals(rows.size(), 10);

driver.findElement(By.id("search-box")).sendKeys("Divya");
Assert.assertEquals(driver.findElements(By.cssSelector("#records-body tr")).size(), 1);

driver.findElement(By.id("add-record")).click();
driver.findElement(By.id("f-first")).sendKeys("Arun");
driver.findElement(By.id("f-last")).sendKeys("Kumar");
driver.findElement(By.id("f-email")).sendKeys("arun@example.com");
driver.findElement(By.id("f-age")).sendKeys("28");
driver.findElement(By.id("f-dept")).sendKeys("QA");
driver.findElement(By.id("save-record")).click();