selenium element not interactable exception: how to fix
Resolves Selenium ElementNotInteractableException: hidden, disabled, or overlapped elements. Use when click/send_keys fails on interactability. Not for stale elements.
TL;DR
Selenium refuses elements a user could not use: hidden, disabled, or covered. Scroll it into view, reveal it through the UI, or confirm it should be interactable at all before working around it.
Error
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactableSteps
- Screenshot at failure and check the element's state: displayed, enabled, and unobscured. Expected: you see which check failed.
- If it is below the fold, scroll:
driver.execute_script("arguments[0].scrollIntoView(true);", el). Expected: in viewport, then interact. - If a real user must reveal it first (hover menu, open accordion), add those steps. Expected: the UI flow makes it interactable.
- If it is disabled, stop: a disabled control the test forces is a test bug, not an app bug. Expected: the test respects disabled state.
- Only for legitimate hidden inputs (file uploads), set the value via script. Expected: narrow, documented workaround.
When to use
ElementNotInteractableExceptionon click or send_keys.- Elements that need scrolling or revealing.
When not to use
- Stale element (re-find instead).
- Elements covered by overlays users cannot dismiss (product bug).
Tool compatibility
- Selenium 4.x;
execute_scriptfor scrolling.
Variant phrasings
element not interactable in Selenium Python
Same error; the binding does not matter.
Selenium cannot click hidden element
Decide reveal-vs-workaround explicitly.
Why it happens
Selenium mirrors user capability: it will not click what a user could not click. This is usually correct and the test is wrong.
Edge cases
display:noneinputs for file upload are the legitimate workaround case.- Animations make elements briefly uninteractable; wait for the animation end.
- Fixed headers cover scrolled-to elements; scroll with an offset.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_QE4BrZmAYFk9HR3vf4jwlg
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.