1

Is there a way to get around the elementNotInteractable exception in selenium? I've used

wait.until(ec.element_to_be_clickable())

But my code will still try to interact with elements before they're fully interactable. Is the problem that I just haven't set the delay high enough when defining wait? Or is there a function like

ec.element_to_be_interactable()

which checks if the element is interactable or not?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • What html element are you trying to interact with and url of the element. – Arundeep Chohan Dec 21 '21 at 03:59
  • Not sure if there's a more accessible example, but I'm trying to access the search bar in TCGPlayer's seller portal, which will be clickable but not interactable for a short amount of time after changing the values of the dropdowns on the search function. I've had to code in time.sleep() repeatedly to get around the wait, since using clickable will just cause selenium to freak out and crash. – Clockknight Dec 21 '21 at 06:15

1 Answers1

0

element_to_be_clickable()

element_to_be_clickable() is the expectation for for checking if an element is visible and enabled so that you can click() it.


ElementNotInteractableException

Unfortunately there is no specific expected_conditions as ElementNotInteractableException and it can occur for a lot of reasons and some of them are:

  • Lower Timeout interval. In these cases you have to increase the timeout as follows:

    wait = WebDriverWait(driver, 20)
    
  • Selecting and invoking click() the outer/parent element rather then the child element.

  • A typical scenario is targetting the <input> where there is a related <label> element.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352