Reputation: 107
I`m trying to entering a text into TinyMCE rich text in Firefox 27.0 using selenium webdriver 2.40.0 but it failed to work.
Here is the line of code:
driver.switchTo().frame("summary_ifr");
driver.switchTo().activeElement().sendKeys("abc"));
driver.switchTo().defaultContent();
Your help would be appreciated.
Thanks,
Saurabh
Upvotes: 1
Views: 999
Reputation: 3129
Created an example which worked for me in Firefox with WebDriver 2.40.0 :
WebDriver driver = new FirefoxDriver();
driver.get("http://www.tinymce.com/index.php");
driver.switchTo().frame("editMe_ifr");
WebElement editor = driver.findElement(By.tagName("body"));
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("arguments[0].innerHTML = '<h1>Heading</h1>Hello World'", editor);
Please see if this helps you anyway!
Upvotes: 2