vendredi 8 mai 2015

How to set caret position in contenteditable span and then sendKeys?

<span name="workitemContent" contenteditable="">root 0 child 0 zzzz</span>

For instance, how could I use protractor to set my cursor after the word "child" and then send additional text (with sendKeys or similar) into the span at that position?

Afterwards it might look like:

<span name="workitemContent" contenteditable="">root 0 child with red hair 0 zzzz</span>

I've seen other questions that answer how to do this with JavaScript (such as How to set caret(cursor) position in contenteditable element (div)?), but not with protractor.

Aucun commentaire:

Enregistrer un commentaire