JS Testing Academy · QA Demo Site

Date Picker

A native date input, a native date-and-time input, and a custom calendar built from buttons – the custom one is what most real applications use.

Custom calendar

Practice tasks

  1. Set the native date input with sendKeys / fill and assert its value.
  2. Set the date-and-time input and assert both parts are stored.
  3. Open the custom calendar, move two months forward and assert the month label changed.
  4. Pick day 15 in the custom calendar and assert the input shows that date.
  5. Assert the custom input is read-only, so typing into it does nothing.
Sample automation code
driver.findElement(By.id("date-input")).sendKeys("15-08-2026");   // format depends on the locale
Assert.assertEquals(driver.findElement(By.id("date-input")).getAttribute("value"), "2026-08-15");

driver.findElement(By.id("custom-date")).click();
driver.findElement(By.id("next-month")).click();
driver.findElement(By.xpath("//div[@id='cal-days']//button[text()='15']")).click();