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
375 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
• 27,180 points
There where 03 possible solutions for it:

1. When page is rendering at that time selenium trying to click. Solution is add explicit wait
2. If developer has developed website in a such way like element is not interact then find it's parent element and using xpath child function you can implement it. Example: //div[contains(@class = 'abc')]::*

3. Find element's coordinate and try to click on element using coordinate
Hi Shreyans, thank you for your answer. You explained it really well.

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,110 points
1,714 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
7,386 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,110 points
965 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
1,125 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
867 views
+1 vote
1 answer

how do I escape the "/" in a textarea for Python3.7 with Selenium

@tchrisev, try using Robot class with following commands after your send_keys() ...READ MORE

answered Oct 29 in Selenium by Abha
• 27,180 points
89 views