How do I resolve the ElementNotInteractableException in Selenium WebDriver?

0 votes
How do I resolve the ElementNotInteractableException in Selenium WebDriver?
Aug 20 in Selenium by Abish
25 views

1 answer to this question.

0 votes

Hi Abish, ElementNotInteractableException occurs when an element is found, but you can't be interacted with. For instance, you may not be able to click or send keys. This could happen due to various reasons like element being not visible or displayed, element is off screen or element is behind another element or hidden. So, you can perform some of the actions to make element interactable:

1. Wait until an element is visible / clickable

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

2. Scroll until the element is within the the display

Actions action = new Actions(driver);
action.moveToElement(element);

3. Use JS Executor to interact directly with the DOM

JavascriptExecutor javascript = (JavascriptExecutor) driver;
javascript.executeScript("var element = document.querySelector('locator'); element.value = 'whatever';")
answered Aug 21 by Abha
• 22,960 points

Related Questions In Selenium

0 votes
1 answer

How do i change the location where my file gets downloaded in Selenium Webdriver and firefox driver?

There are a couple of errors there. ...READ MORE

answered Apr 12, 2018 in Selenium by nsv999
• 5,090 points
1,505 views
0 votes
1 answer

How do I get current URL in Selenium Webdriver using Python?

Use current_url element. Example: print browser.current_url READ MORE

answered Aug 8, 2018 in Selenium by Meci Matt
• 9,420 points
5,586 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
564 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
895 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
559 views
0 votes
1 answer