Thursday 3 May 2012

CKeditor with Selenium IDE


There are two ways to deal with Ckeditor

1)
focus  |  class=cke_show_borders
typeKeys |  class=cke_show_borders  | testing content

'cke_show_borders' is a class of body area

2)

runScript | CKEDITOR.instances["editor1"].setData('
testContent
');

'editor1' is instance of Ckeditor






































With help of these option you can able to tackle with CKeditor.

9 comments:

  1. Awesome! Thanks ;)

    ReplyDelete
  2. Hey this works really well thanks.
    Do you know how the read the data back once set? I have tried many attempts using getData() but could not get it to work.

    ReplyDelete
  3. What you want to perform? Can you please elaborate in detail??

    ReplyDelete
  4. Mike, you can use
    String mk = selenium.getValue("locator of that particular field");

    ReplyDelete
  5. I can write in ckeditor using both ways.
    But my problem is: on my page I have a button to save/send some data (from ckeditor too) and when Selenium clicks on Save-button, the written data in ckeditor disappear (!?)
    Any ideas to solve my problem?

    ReplyDelete
  6. me too I have the same problem

    ReplyDelete
  7. "I can write in ckeditor using both ways.
    But my problem is: on my page I have a button to save/send some data (from ckeditor too) and when Selenium clicks on Save-button, the written data in ckeditor disappear (!?)"

    I have the same problem

    ReplyDelete
  8. At the moment, I get around the not saved issue with a "pause 2500" after the set.Data.

    Less than ideal - but works.

    ReplyDelete
  9. Thanks bud. I spent hours looking for a way to get selenium to enter text in a CKEditor element. Method 2 did the trick.

    ReplyDelete