ElementNotInteractableException: Message: Element is not reachable by keyboard

I have the following snippet of JS code in a form that I want to use Selenium to input:

<oj-input-password id="idcs-signin-basic-signin-form-password" data-idcs-placeholder-translation-id="idcs-password-placeholder" class="oj-sm-12 oj-inputpassword oj-form-control oj-component oj-complete" value="{{password}}" placeholder="[[bundle('signin.password')]]" labelled-by="ui-id-2"><input data-oj-internal="" type="password" placeholder="Password" class="oj-inputpassword-input oj-component-initnode" id="idcs-signin-basic-signin-form-password|input"></oj-input-password>

I’m trying to enter the password:

password = browser.find_element_by_id('idcs-signin-basic-signin-form-password')
password.send_keys("my_password")

But then I get the following error:

selenium.common.exceptions.ElementNotInteractableException: Message: Element <oj-input-password id="idcs-signin-basic-signin-form-password" class="oj-sm-12 oj-inputpassword oj-form-control oj-component oj-complete"> is not reachable by keyboard

Why does this happen and what’s the workaround?

Answer

I would suggest you to use ActionChains

from selenium.webdriver.common.action_chains import ActionChains
ActionChains(driver).move_to_element(driver.find_elements_by_css_selector("input[type='password'][placeholder='Password']")).send_keys('your password').perform()

also make sure to launch browser in full screen mode. and if scrolling is required, I would suggest you to do that as well.