Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to handle tinyMCE when automating with watir-webdriver?
    primarykey
    data
    text
    <p>I'm evaluating Watir-webdriver, to decide if i can switch to using it for my browser tests (from Watir mostly) and one of the key things would be the ability to interact with TinyMCE WYSIWYG editors, as a number of the applications I work with use TinyMCE. I've managed to get the following solution working -</p> <pre><code>@browser = Watir::Browser.new(:firefox) @browser.goto("http://tinymce.moxiecode.com/tryit/full.php") autoit = WIN32OLE.new('AutoITX3.Control') autoit.WinActivate('TinyMCE - TinyMCE - Full featured example') @browser.frame(:index, 0).body.click autoit.Send("^a") # CTRL + a to select all autoit.Send("{DEL}") autoit.Send("Some new text") </code></pre> <p>The drawback of this approach, is that by using autoit, I remain dependent on Windows and the ability to run tests cross-platform is one of the attractions of webdriver.</p> <p>I noticed some webdriver specific solutions such as the following from <a href="http://groups.google.com/group/webdriver/browse_thread/thread/4c2f87242bb2ff83?pli=1" rel="nofollow">this thread</a>:</p> <pre><code>String tinyMCEFrame = "TextEntryFrameName" // Replace as necessary this.getDriver().switchTo().frame(tinyMCEFrame); String entryText = "Testing entry\r\n"; this.getDriver().findElement(By.id("tinymce")).sendKeys(entryText); //Replace ID as necessary this.getDriver().switchTo().window(this.getDriver().getWindowHandle()); try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } this.getDriver().findElement(By.partialLinkText("Done")).click(); </code></pre> <p>Which looks like it might work cross-platform but I don't know if the same functionality can be accessed from within Watir-webdriver. My question is, is there a way to write, delete and submit into TinyMCE using watir-webdriver, which will not enforce a dependency on a specific supported browser or operating system?</p>
    singulars
    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.
 

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