Here I have the image of my code and the image of my error. Can anyone help me to resolve this issue?

- 183,867
- 41
- 278
- 352

- 505
- 1
- 4
- 10
-
1You should try to isolate element you want to interact with. in your code there are multiple elements having tag; so its better if you use specific path to that element – Kushal Bhalaik May 09 '17 at 15:09
-
13Please do not post images of text, rather keeping as text. – SiKing Aug 09 '17 at 22:18
6 Answers
ElementNotInteractableException
ElementNotInteractableException is the W3C exception which is thrown to indicate that although an element is present on the HTML DOM, it is not in a state that can be interacted with.
Reasons & Solutions :
The reason for ElementNotInteractableException to occur can be numerous.
Temporary Overlay of other
WebElement
over theWebElement
of our interest :In this case, the direct solution would have been to induce
ExplicitWait
i.e.WebDriverWait
in combination withExpectedCondition
asinvisibilityOfElementLocated
as folllows:WebDriverWait wait2 = new WebDriverWait(driver, 10); wait2.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("xpath_of_element_to_be_invisible"))); driver.findElement(By.xpath("xpath_element_to_be_clicked")).click();
A better solution will be to get a bit more granular and instead of using
ExpectedCondition
asinvisibilityOfElementLocated
we can useExpectedCondition
aselementToBeClickable
as follows:WebDriverWait wait1 = new WebDriverWait(driver, 10); WebElement element1 = wait1.until(ExpectedConditions.elementToBeClickable(By.xpath("xpath_of_element_to_be_clicked"))); element1.click();
Permanent Overlay of other
WebElement
over theWebElement
of our interest :If the overlay is a permanent one in this case we have to cast the
WebDriver
instance asJavascriptExecutor
and perform the click operation as follows:WebElement ele = driver.findElement(By.xpath("element_xpath")); JavascriptExecutor executor = (JavascriptExecutor)driver; executor.executeScript("arguments[0].click();", ele);

- 183,867
- 41
- 278
- 352
-
10This should be marked as correct answer, but for #2 it needs to be said, that there might be a reason why the overlay is there. In such case one needs to consider, whether getting around it with javascript executor is not actually getting around an unexpected behavior of app. – peepa Jun 07 '18 at 13:01
-
2For future readers of this thread: An example of "numerous possibilities" as @DebanjanB states, turned out in my case to be, that an link that was in ablock that was 'closed' was being clicked on; 'click'ing the– Snidhi Sofpro Apr 25 '19 at 10:36block open and then 'click'ing the link resolved the issue!
-
does someone know how to realize `ExpectedConditions` in Javascript please? – Don Diego Dec 29 '20 at 16:50
-
1excellent! permanent overlay is very common no matter what we try sometimes. – imbr Aug 04 '22 at 16:45
I got this because the element I wanted to interact with was covered by another element. In my case it was an opaque overlay to make everything r/o.
When trying to click an element UNDER another element we usualy get "... other Element would receive the click " but not always :.(

- 71
- 8
This Exception we get when the element is not in an interactable state. So we can use wait till the element is Located or become clickable.
Try using the Implicit wait:
driver.manage().timeouts().implicitlyWait(Time, TimeUnit.SECONDS);
If this is not working use Explicit wait:
WebDriverWait wait=new WebDriverWait(driver, 20); WebElement input_userName; input_userName = wait.until(ExpectedConditions.elementToBeClickable(By.tagName("input"))); input_userName.sendkeys("suryap");
You can use ExpectedCondition.visibilityOfElementLocated()
as well.
You can increase the time, for example,
WebDriverWait wait=new WebDriverWait(driver, 90);

- 4,940
- 1
- 20
- 21

- 1,314
- 1
- 4
- 17
Actually the Exception is Element Not Visible
The best practice is to use Implicit wait
below driver Instantiation so it get sufficient time to find element throughout the exception
driver.get("http://www.testsite.com");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Still facing issue as some element require more time. Use ExplicitWait
for individual element to satisfy certain condition
In your case you are facing element not visible exception
then use wait condition in following way-
WebDriverWait wait = new WebDriverWait(driver, 120);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.your_Elemetnt));

- 7,577
- 10
- 44
- 82
-
I also that one also. But it doesn't work. Could you please tell me some other way to solve this issue? – Aarthi May 10 '17 at 11:18
-
Implicit wait is not a best practice. In fact it's use is recommended against by the Selenium contributors. Also mixing implicit and explicit waits is warned against in the official docs. – JeffC Nov 04 '17 at 03:56
-
Wait is not a solution... in my case i need to click on ant UI time picker component. Waiting is not a solution and im still looking for workaround – user1767083 Jul 16 '20 at 17:03
-
@user1767083 Obviously wait is not a solution for each problem. Post a separate question with appropriate details on SO. You will definitely get a solution. Thanks – NarendraR Jul 16 '20 at 18:04
-
@NarendraR this is the problem i face, https://stackoverflow.com/questions/62907372/compound-class-names-not-permitted-selenium-java/62907552#62907552 – user1767083 Jul 17 '20 at 07:51
-
@user1767083, Is there any similarity in your question and in this question ? Both questions are completely different. Where did you put the wait ? and come to know that _`wait is not a solution`_ ? – NarendraR Jul 17 '20 at 07:57
-
@NarendraR I have change the locator strategy and then i met error describe in this thread. There after I have tried given solutions. but it was not the solution. still i looking for solution. – user1767083 Jul 18 '20 at 08:11
A solution to this for Javascript looks like this. You will have to modify the time to suit your need.
driver.manage().setTimeouts({ implicit: 30000 });
Hope this is helpful to someone. see the docs for reference

- 421
- 4
- 5
-
3Never use sleep() or setTimeout() to wait for an event. It's a bad practice and you'll end up with a situation where your code randomly stops working when you deploy it on a new machine, but it was working perfectly until then. Events should be handled by waiting operations, designed to wake up your code as soon as the condition has been met or a timeout occurred. – Mladen B. Jun 14 '19 at 12:59
In my case issue was because there is some animation, and that element is not visible for some duration. And hence exception was occurring.
For some reason I couldn't make ExpectedConditions.visibilityOfElementLocated work, so I created a code to wait for some hardcoded seconds before proceeding.
from selenium.webdriver.support.ui import WebDriverWait
def explicit_wait_predicate(abc):
return False
def explicit_wait(browser, timeout):
try:
Error = WebDriverWait(browser, timeout).until(explicit_wait_predicate)
except Exception as e:
None
And now I am calling this explicit_wait function wherever I want to wait for sometime e.g.
from selenium import webdriver
from selenium.webdriver.common.by import By
browser = webdriver.Safari()
browser.get('http://localhost')
explicit_wait(browser,5) # This will wait for 5 secs
elem_un = browser.find_element(By.ID, 'userName')

- 1,073
- 10
- 23