I am using Webdriver in Java with Firefox 14.
My problem is that I cannot get webdriver to play well with CkEditor. I was looking for solutions, but could not work in Firefox 13 or 14. These are the solutions I tried:
Normal sendKeys connection
textArea.sendKeys();
or
textArea.click();
textArea.sendKeys();
Result : this code will not print any text in CkEditor
Selenium issue code 3890
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!");
Result: This code will go to the site and clear the editor, but will not put any text into the CkEditor instance.
AdvancedUserInteractions - for example. Actions () in several ways
textArea.click();
new Actions(driver).sendKeys("Hello, ckeditor!").build().perform();
and
new Actions(driver).sendKeys(textArea, "Hello, ckeditor!").build().perform();
and
new Actions(driver).click(textArea).sendKeys("Hello, ckeditor!").build().perform();
Result . This will not lead to the creation of any text in CkEditor
( 3890 ) AdvancedUserInteractions
:
driver.switchTo().frame(iframe);
textArea.click();
new Actions(driver).sendKeys("Hello, ckeditor!").build().perform();
: "c.value is undefined"
Javascript CkEditor Api
JavascriptExecutor js = (JavascriptExecutor) d;
System.out.println("[debug] Set Text: " + setText);
js.executeScript("CKEDITOR.instances.editor1.setData('<p> "+ setText +"</p>');");
: '/', "org.apache.commons.lang.StringEscapeUtils.escapeHtml" "setText" Html. ": null" .
, ? , ? ?
!