Note that there are some explanatory texts on larger screens.

plurals
  1. POusing Selenium Webdriver with CkEditor in Firefox 14
    primarykey
    data
    text
    <p>I am using Webdriver in Java with Firefox 14.</p> <p>My problem is that I can't seem to get webdriver to play nicely with CkEditor. I have looked for solutions but have been unable to get any working in either Firefox 13 or 14. These are the solutions that I have tried:</p> <ol> <li><p>The normal sendKeys interction</p> <pre><code>textArea.sendKeys(); </code></pre> <p>or</p> <pre><code>textArea.click(); textArea.sendKeys(); </code></pre> <p><strong>Result</strong>: This code wouldn't produce any text in the CkEditor</p></li> <li><p>The code from <a href="http://code.google.com/p/selenium/issues/detail?id=3890">Selenium issue 3890</a></p> <pre><code>d.get("http://ckeditor.com/demo"); WebElement iframe = d.findElement(By.tagName("iframe")); d.switchTo().frame(iframe); WebElement tinymce = d.findElement(By.tagName("body")); tinymce.clear(); tinymce.sendKeys("Hello, ckeditor!"); </code></pre> <p><strong>Result:</strong> This code will go to the site and clear the editor, but won't put in any text into the CkEditor instance.</p></li> <li><p><a href="http://code.google.com/p/selenium/wiki/AdvancedUserInteractions">AdvancedUserInteractions</a> -- eg. Actions() in multiple variations</p> <pre><code>textArea.click(); new Actions(driver).sendKeys("Hello, ckeditor!").build().perform(); </code></pre> <p>and </p> <pre><code>new Actions(driver).sendKeys(textArea, "Hello, ckeditor!").build().perform(); </code></pre> <p>and</p> <pre><code>new Actions(driver).click(textArea).sendKeys("Hello, ckeditor!").build().perform(); </code></pre> <p><strong>Result</strong>: These won't produce any text in the CkEditor</p></li> <li><p>Switching iframes (as per Issue 3890 above) and using AdvancedUserInteractions</p> <p>Code similar to:</p> <pre><code>driver.switchTo().frame(iframe); textArea.click(); new Actions(driver).sendKeys("Hello, ckeditor!").build().perform(); </code></pre> <p><strong>Result</strong>: Throws error "<em>c.value is undefined</em>"</p></li> <li><p>Using the Javascript and the CkEditor Api</p> <pre><code>JavascriptExecutor js = (JavascriptExecutor) d; System.out.println("[debug] Set Text: " + setText); js.executeScript("CKEDITOR.instances.editor1.setData('&lt;p&gt; "+ setText +"&lt;/p&gt;');"); </code></pre> <p><strong>Result</strong>: Excludes the '/' character when "<em>org.apache.commons.lang.StringEscapeUtils.escapeHtml</em>" is/isn't used to convert "<em>setText</em>" to Html entries. This solution also throws an "<em>ERROR: null</em>" on large strings. </p></li> </ol> <p>Any ideas on things that I haven't tried? Fixes for things I have tried? Any other suggestions?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload