sendKeys not working with "div contenteditable"


#1

Example:
<div id=“textarea” contenteditable=“plaintext-only”>Hello, World…!</div>

{
“Command”:“sendKeys”,
“Target”:"//*[@id=“textarea”]",
“Value”:“Another text”
}


#2

Hi, instead of using sendkeys, please try the editContent command.

The editContent command supports editing content-editable elements, e.g., rich text editors. After a user edits the content of a content-editable element while recording, a corresponding editContent command will be automatically generated, which is triggered by detecting the focus removal of the element.


#3

I’m trying and get [error] Target is not contenteditable.

it work for contenteditable=“true” and not working contenteditable=“plaintext-only”
and before use editContent command i use storeEval command to change it attribute = “true” but it get [error] not allowed Content-Security-Policy…

{
“Command”: “storeEval”,
“Target”: “document.getElementById(“textarea”).contentEditable = “true””,
“Value”: “”
}

How to change attribute value contenteditable=“true” ??
Thanks for your reply. :slightly_smiling_face:


#4

Hmm… a link to the website or the edit component it is using would be helpful, so that we can test it.