Selenium error

ElementNotInteractableException: element not interactable

Selenium found the element in the DOM, but it can't be clicked or typed into right now: it's hidden, zero-sized, or not the element you actually meant.

Published

Why this happens

How to fix it

  1. Wait for `ExpectedConditions.elementToBeClickable(...)`, not just for the element to be present
  2. Tighten the locator so it only matches the visible element, and check how many elements it matches with `findElements(...).size()`
  3. Target the real `<input>` element rather than its styled container
  4. Set a fixed window size (e.g. 1920x1080) in headless runs so the layout matches what you tested locally

Example


              WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement email = wait.until(
    ExpectedConditions.elementToBeClickable(By.cssSelector("input[name='email']")));
email.sendKeys("qa@example.com");