My answer to this question on Quora:
ElementNotInteractableException is caused when an element is found, but you can not interact with it. For instance, you may not be able to click or send keys.
There could be several reasons for this:
- The element is not visible / not displayed
- The element is off screen
- The element is behind another element
- Some other action needs performed (by the user) to enable it.
Strategies that may work to make it interactable (depending on the circumstance.)
- Wait until an element is visible / clickable
WebDriverWait wait = new WebDriverWait(driver, timeout); wait.until(ExpectedConditions.visibilityOf(element)); wait.until(ExpectedConditions.elementToBeClickable(element));
- Scroll until the element is within view
Actions action = new Actions(driver); action.moveToElement(element);
- Perform whatever other action is necessary and possibly wait until after that.