I'm trying to enter text into a text box using python selenium.
The html looks like below:
<div class="sendBox placeholder" contenteditable="true" data-placeholder="Type a message or drop attachment..." id="sendMessage" style="height: 375px;"></div>
After manually typing 'TEST' into the text box, the html looks like this:
<div class="sendBox placeholder" contenteditable="true" data-placeholder="Type a message or drop attachment..." id="sendMessage" style="height: 375px;">TEST</div>
I've tried the following code, but there is no response
driver.find_element_by_xpath("//div[@id='sendMessage']").send_keys("testing")
However, if I manually click on the text box so that the cursor shows up and then enter in that code, it does work. I haven't been able to figure out how to make the curser show up via python selenium. I've tried the below though.
driver.find_element_by_xpath("//div[@id='sendMessage']").click()
inputortextareawhich is, probably, hidden, but has the same value/innerHTML as your content editable div?