Selenium and TinyMCE

Selenium is a tool to automatically test your web interface. You have to write a set of commands, which Selenium will execute and report if something did fail. Selenium IDE is the plugin for Firefox that enables you to create these commands.

If you are using TinyMCE as your WYSIWYG editor for textboxes, you might have a problem. Since TinyMCE runs in an iframe, it is not simple to add content to that.

The easiest way I found to add a text to your TinyMCE is to add it via Javascript. Use runScript as the method and use this javascript command: tinyMCE.activeEditor.setContent(“A banana is an edible fruit produced by several kinds of large herbaceous flowering plants of the genus Musa”);

Or paste this in the contents of your Selenium file:

<tr>
<td>runScript</td>
<td>tinyMCE.activeEditor.setContent(&quot;A banana is an edible fruit produced by several kinds of large herbaceous flowering plants of the genus Musa.&quot;);</td>
<td></td>
</tr>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.