ide: Selenium IDE is not able to recognize CK editor text area

3,783 views
Skip to first unread message

Jijo john km

unread,
Feb 11, 2011, 5:29:15 AM2/11/11
to Selenium Users
We are using the CK editor (http://ckeditor.com/) in our application.
When we try to record a script for entering data in CK editor, the
Selenium IDE not recognizing the text area.
Selenium IDE is able to recognize the options (like bold, Italic,
etc..) which are outside of the text area.

Do anyone have encountered this issue and are we having any
workaround?

Thanks in advance,
Jijo

AV

unread,
Feb 11, 2011, 12:34:05 PM2/11/11
to Selenium Users
I am having the same issue with my description (text editor) field.
Selenium IDE is not recording the field. If you get a solution for
this, please let me know too.

Thanks,
Anna

AV

unread,
Feb 11, 2011, 6:03:01 PM2/11/11
to Selenium Users
Hi,
I was having the same issue and finally got it to work. I dowloaded
xpath checker (firefox plugin) and then right clicked on the field
that was not recording and got the id. Mine was the texteditor with id
"tinymce". Then I manually entered the command in my Selenium and
filled the fields as follows:
Command = type
Target = tinymce
Value = test

It worked for me. Hope this helps.

Thanks,
A

On Feb 11, 2:29 am, Jijo john km <jj...@intrack.com> wrote:

petertalkman

unread,
Apr 5, 2011, 10:52:01 PM4/5/11
to Selenium Users
Selenium can't record type action on CK editor's textarea, because
actually the textarea has been transfered to an iframe, not textarea,
so what you really do when typing is type words into that iframe ( by
javascript ). So in order to solve this problem, we have to call
CKEditor's code to setData into that textarea.

My solution is to write a function into 'user-extension.js', that will
become a command which will apear in your ide command dropdownlist.

Below is my code, hope it will help ~

Selenium.prototype.doInsertCKEditor = function(locator,word)
{
this.doWaitForCondition("var x =
Selenium.browserbot.findElementOrNull('//td[@id=\"cke_contents_form
\"]');x != null;", "50000");
this.doRunScript("CKEDITOR.instances['"+locator+"'].setData('"+word
+"');");
}


The locator variable is your textarea's name, and the word variable is
the words you want to input to that textarea.

Command 'insertCKEditor' will apear in Selenium IDE, you just need to
call it and pass the two variable's value, and problem solved !

Don't forget to include 'user-extension.js' and restart your Selenium
IDE.

ptm

mak capri

unread,
Jun 19, 2013, 12:25:07 AM6/19/13
to seleniu...@googlegroups.com
same issue with me.. written data disappears after submitting form.. any help would be appreciated

On Friday, November 9, 2012 8:27:35 PM UTC+5, Daci wrote:
I can write in ckeditor with both methods:
1. focus  |  class=cke_show_borders
typeKeys |  class=cke_show_borders  | testing content

2. runScript | CKEDITOR.instances["editor1"].setData('testing content
');

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?

Ryan Shuya

unread,
Jun 27, 2013, 1:20:26 PM6/27/13
to seleniu...@googlegroups.com
I was able to get the text to stay put by putting a pause after my runScript command.

Marek Cichowski

unread,
Jul 15, 2013, 7:52:43 AM7/15/13
to seleniu...@googlegroups.com
Dear all,

I am confirming the solution with the new command "InsertCKEditor" which works fine in the single step mode of Selenium IDE.
For execution without breakpoints I had to add "pause 100 ms" commands after each InsertCKEditor command.

BR

Marek
Reply all
Reply to author
Forward
0 new messages