JS Testing Academy · QA Demo Site

Practice Form

The full form: text fields, radio buttons, a date picker, a multi-select, checkboxes, file upload and dependent dropdowns. Submit opens a modal with everything you entered.

Practice tasks

  1. Fill every field and submit; assert the modal opens and each value is shown in the table.
  2. Submit with an empty first name and assert the error list contains First name is required.
  3. Enter a 9-digit mobile number and assert the mobile validation error appears.
  4. Select a state and assert the city dropdown becomes enabled with the right options.
  5. Select two subjects and assert both appear in the modal.
  6. Close the modal and assert it is no longer visible.
Sample automation code
driver.findElement(By.id("firstName")).sendKeys("Karthik");
driver.findElement(By.id("lastName")).sendKeys("Raj");
driver.findElement(By.id("userEmail")).sendKeys("karthik@example.com");
driver.findElement(By.id("gender-male")).click();
driver.findElement(By.id("userNumber")).sendKeys("9876543210");

new Select(driver.findElement(By.id("state"))).selectByVisibleText("Tamil Nadu");
new Select(driver.findElement(By.id("city"))).selectByVisibleText("Salem");

driver.findElement(By.id("submit-form")).click();
WebElement modal = driver.findElement(By.id("result-modal"));
Assert.assertTrue(modal.isDisplayed());