0

I'm trying to automate login to a website using Selenium. The email field element has id="Email" enter image description here

after locating the element i try to send it a sample email:

user_field = browser.find_element(By.ID, "Email")
user_field.send_keys("firstName.lastName@gmail.com")

However, i get this error:

selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="Email" class="form english" name="data[Email]" type="text"> is not reachable by keyboard

I read ElementNotInteractableException: Message: Element is not reachable by keyboard error sending text to input field using Selenium and Python but it doesn't seem to work for me.

WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='Email']"))).send_keys('firstName.lastName@gmail.com')

I'd appreciate if you could give any pointers because I'm very new to Selenium.

Amir
  • 53
  • 8
  • 1
    can you please try clicking the input element before entering values in it? – Jake Peralta Jan 11 '23 at 09:34
  • Do you have the URL to the site ? It is possible that the ID ```Email``` is not unique itself. Check if there's multiple elements sharing the same ID. Because the element you trying to locate doesn't seems to be identical with the one shown in error message. – Frederickcjo Jan 11 '23 at 09:34
  • @Amir Please close the question as you have got your solution. – Jake Peralta Jan 12 '23 at 06:38

1 Answers1

0

Like @Jake Peralta pointed out, clicking on the field before using send_keys was the correct approach.

user_field = browser.find_element(By.CSS_SELECTOR, ".form-control.medium.english#Email")
user_field.click()
user_field.send_keys(user)
Amir
  • 53
  • 8