Type in the ckeditor window

From Edgar BV Wiki
Jump to navigation Jump to search

There are (unfortunately) several solutions for this. The one I found to work most easily was:

create a file user-extension.js

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
+"');");
} 

In the IDE go to Options > options > Selenium Core Extension > Browse and select the user-extension.js file

restart the IDE. You now have a command insertCKEditor.

The Target is the name of the textarea around the CKEditor. When recording using the IDE it should be the id that Selenium finds, but if you're looking at the inspector in the div, you will find <textarea id="edit-body-und-0-value" ...

The IDE command becomes:

Command: insertCKEditor

Target: edit-body-und-0-value

Value: I want this text plox

You may want to pause it some after running this command.

This came from https://groups.google.com/forum/#!topic/selenium-users/dF7FE2Mru4k

Not working AFAIK

http://radical-qa.blogspot.nl/2012/05/ckeditor-with-selenium-ide.html

http://sqa.stackexchange.com/questions/6275/ckeditor-recording-problem-selenium-ide