문제

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

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top