How do I resolve the ElementNotInteractableException in Selenium WebDriver?

0 votes
How do I resolve the ElementNotInteractableException in Selenium WebDriver?
Aug 20, 2019 in Selenium by Abish
21,772 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, 2019 by Abha
• 27,930 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.
3rd point can u explain detailed.
Hey, did you mean @Abha's answer or @shreyan's answer?
HI,

I tried this way of 3 steps but getting issue that cannot set property value of null

Hello,

Which 3 steps are you talking about? @ Abha solution or @Shreyans shah? and  share more information about your problem

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,510 points
3,298 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,460 points
18,728 views
0 votes
1 answer
0 votes
1 answer

How do I increase or decrease the sleep time in clickAndWait command in selenium IDE?

If you are using Selenium Webdriver, you have ...READ MORE

answered Feb 28, 2019 in Selenium by Vaishnavi
• 1,180 points
677 views
0 votes
2 answers

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,510 points
3,526 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,533 views
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,890 points
2,595 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
2,862 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, 2019 in Selenium by Abha
• 27,930 points
228 views
+1 vote
1 answer