JS Testing Academy · QA Demo Site

Auto Complete

Type to filter suggestions. One field takes a single value, the other collects several values as removable chips.

Practice tasks

  1. Type sel in the single field and assert only matching suggestions are listed.
  2. Click a suggestion and assert the input holds that value.
  3. In the multi field add three values and assert three chips exist.
  4. Remove one chip with its ✕ button and assert the count drops to two.
  5. Type something with no match and assert the No match message appears.
Sample automation code
driver.findElement(By.id("single-auto")).sendKeys("sel");
new WebDriverWait(driver, Duration.ofSeconds(5))
    .until(ExpectedConditions.visibilityOfElementLocated(By.id("single-suggestions")));
List<WebElement> options = driver.findElements(By.cssSelector("#single-suggestions li"));
Assert.assertEquals(options.size(), 1);
options.get(0).click();
Assert.assertEquals(driver.findElement(By.id("single-auto")).getAttribute("value"), "Selenium");