Adding Content in CKEditor Instance Thorugh Selinuim Test

By: admin

25 Mar 2011

While writing an selinium test I came across an problem while adding text to the ckEditor instance thorugh the test. And after a long search and research I got the below solution.

Command works is runscript() :
Usage : runscript(script);
Example :
runScript(CKEDITOR.instances["edit-body"].setData('<p>testContent</p>'); );

where "edit-body", is the instance name of the loaded ckdeditor.

Hope this helps someone. :)
 

 

3 Responses to Adding Content in CKEditor Instance Thorugh Selinuim Test

blacknight (not verified)

Thursday, September 8, 2011 - 21:47   reply 

Hi,

I tried this piece of code with Selenium. But when i try this i get an error as "CKEDITOR is not defined".

What am i doing wrong here? Can you please help me?

admin's picture

admin

Friday, September 9, 2011 - 10:52   reply 

Are you able to see the editor instance while the test in running ??
I think before the command add a wait of few seconds. So that the editor is loaded properly before our command is run.

Guest (not verified)

Thursday, January 19, 2012 - 06:03   reply 

HI,
This page wsa very useful and i got an idea how to deal with ckeditor using selenium IDE but i am unable to find out instance of ck editor i have placed the code can please help me out

thank you
sam

<p> contact information</p>

Rich Text Editor

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

11 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

php.png    firefox.png    open_source.png    ubuntu.png    drupal.png    civicrm.png     jquery

About the Author

admin's picture

About Me

I am : Open source developer.

I love : Drupal & CiviCRM !!

Work : Consultant @ Capgemini

Recent comments

Follow Me

flickr.png    yahoo.png    facebook.png    twitter.png

google.png    youtube.png    wordpress.png   

       wordpress.png

Ohloh profile for rahulbile

User login