Selenium error when interacting with textarea
Question:
I try to enter text into text area on the web i am using selenium to do this but when i try to input into textarea it fails with error:”selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable”.
However when i try to put text into field it works normaly
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').send_keys(text);
Answers:
You could try it with javascript:
driver.execute_script('document.querySelector("textarea.Ypffh").innerText = "xxx"')
Sometimes you might need to click on the textarea before you can interact with it.
I would try this:
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').click();
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').send_keys(text);
If that doesn’t work, I would check to see if there’s a hidden tag near the textarea that may function as the input receiver rather than the textarea itself. Sometimes you see cases where a textarea is just a visual representation, but doesn’t actually receive text, so there may be a hidden that receives text instead.
The text box may be located inside of an Iframe which must be navigated to first. Take a look at this thread
I try to enter text into text area on the web i am using selenium to do this but when i try to input into textarea it fails with error:”selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable”.
However when i try to put text into field it works normaly
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').send_keys(text);
You could try it with javascript:
driver.execute_script('document.querySelector("textarea.Ypffh").innerText = "xxx"')
Sometimes you might need to click on the textarea before you can interact with it.
I would try this:
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').click();
driver.find_element_by_xpath('//textarea[@class = "Ypffh"]').send_keys(text);
If that doesn’t work, I would check to see if there’s a hidden tag near the textarea that may function as the input receiver rather than the textarea itself. Sometimes you see cases where a textarea is just a visual representation, but doesn’t actually receive text, so there may be a hidden that receives text instead.
The text box may be located inside of an Iframe which must be navigated to first. Take a look at this thread