Issue
I am having trouble with a selenium send keys on discord. I am attempting to send a message to a user.
The error I get is:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
The Object im trying to send_keys
that is highlighted by the xpath is as follows:
My code is as follows
inputMessage = wait.until(EC.visibility_of_element_located((By.XPATH,"//div[contains(text(),'Message @')]/..")))
#inputMessage = driver.find_element_by_xpath("//div[contains(text(),'Message @')]/..")
inputMessage.send_keys(msg,Keys.ENTER)
I have attempted several ways to try to solve the error but have not succeeded. Any help would be appreciated. Thank you.
Solution
The ElementNotInteractableException
error tells you that you can't use the send_keys() method on this webElement. I can't really tell you what could work, considering the lack of information considering the problem, but here are some clues :
- Using the ActionsChains to try to input what you want in the field:
from selenium.webdriver.common.action_chains import ActionChains
actions = ActionChains(self.driver)
actions.send_keys('your_data')
actions.perform()
- Try
inputMessage.click()
before you try to send keys
Otherwise, it happened to me too, and the thing was that i tried to send keys to the div, and not to the element which was inside it.
Hopes it help !
Answered By - MatthiasDec
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.