Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Entering values in wysiwyg editor.

Open davelens opened this issue 13 years ago • 6 comments

I'm currently "stuck" trying to enter values into a wysiwyg editor (CKeditor) in a javascript scenario (Selenium2 driver). I'm able to find the element with an XPath query, but can't seem to figure out how to enter values properly in order to submit my form.

How would I go about entering values into a wysiwyg? Is there a best practice to get this done?

davelens avatar Apr 09 '13 10:04 davelens

It depends on how your wysiwyg works (CKeditor). If you can't control it through DOM, then you should be able to control it through JS: https://github.com/Behat/Mink/blob/develop/src/Behat/Mink/Session.php#L260-L280

everzet avatar Apr 09 '13 10:04 everzet

Oh, it didn't occur to me I could do it like this. That should do just fine I think, thanks for the answer!

davelens avatar Apr 10 '13 10:04 davelens

Facing same error but dont know how to fix the error any one can sample code or and example ?

sohailyasmin avatar Dec 23 '13 11:12 sohailyasmin

Facing same error but dont know how to fix the error any one can sample code or and example ?

What "error" are you talking about here, @sohailyasmin ? Doesn't CKEditor controlling through DOM manipulations help in your case?

aik099 avatar Dec 23 '13 11:12 aik099

I am talking about the when i run my behat test for the CK editor it fails and unable to fill value

sohailyasmin avatar Dec 23 '13 11:12 sohailyasmin

Can you please be more specific, e.g. provide scenario output.

I'm guessing, that you've initialized CKEditor from existing textarea and then accessing that textarea by name/id and trying to set value to it in hopes, that it will appear in CKEditor too or via versa.

This doesn't work with CKEditor, since it doesn't communicate real-time with textarea after initialization has happened. If you need for CKEditor to resync it's state with textarea, then you need to call special CKEditor methods (better to see CKEditor docs to find out which ones).

aik099 avatar Dec 23 '13 11:12 aik099