JS Testing Academy · QA Demo Site

Text Box

A simple form. Fill it in, submit it, and the values appear below – the classic first automation exercise.

Practice tasks

  1. Fill every field with valid data, submit, and assert that the output box shows each value.
  2. Submit with an invalid email such as abc@ and assert that #email-error becomes visible.
  3. Submit with all fields empty and assert that the output box stays empty.
  4. Type a very long address (500 characters) and check nothing is cut off in the output.
  5. Click Reset and assert that every field is empty again.
Sample automation code
WebDriver driver = new ChromeDriver();
driver.get("https://jstestingacademy.co.in/qa-demo/elements/text-box.html");

driver.findElement(By.id("userName")).sendKeys("Karthik Raj");
driver.findElement(By.id("userEmail")).sendKeys("karthik@example.com");
driver.findElement(By.id("currentAddress")).sendKeys("31/21 Adaikalanagar, Salem");
driver.findElement(By.id("submit")).click();

String name = driver.findElement(By.id("out-name")).getText();
Assert.assertEquals(name, "Karthik Raj");