How To Resolve Element Not Interactable Exception In Selenium

  
What is ‘element not interactable’ exception in selenium? OR
[exception in thread “main” org.openqa.selenium.elementnotinteractableexception: 
 element not interactable]
When a web element is present in the HTML DOM but it is not in the state that can be 
interacted. In other words when element is found but we can’t interact with it, then it throws ElementNotInteractableException.

Reason behind this exception: –
“element not interactable” exception may occur due to various reason.

Element is not visible
Element is present in off screen (After scroll down it will display)
Element is present behind any other element
Element is disable
  
  
Solutions: –

If element is not visible then wait until element is visible. For this we will use wait
command in selenium

WebDriverWait t = new WebDriverWait(driver, timeout); 
t.until(ExpectedConditions.visibilityOf(element));  
t.until(ExpectedConditions.elementToBeClickable(element));

If element is in off screen then we need to scroll down the browser and interact with element.
We will use JavaScriptExecutor interface that helps to execute JavaScript method through Selenium
Webdriver.

JavascriptExecutor Js1 = (JavascriptExecutor) driver;
Js1.executeScript("window.scrollBy(0,1000)");                   //scroll 1000 pixel vertical