0
<iframe class="cke_wysiwyg_frame cke_reset" frameborder="0" src="" style="width: 100%; height: 100%;" title="Rich Text Editor, scDescription_0" aria-describedby="cke_14" tabindex="0" allowtransparency="true">

How to come inside this iframe and write some text... Please help

Mikev
  • 2,012
  • 1
  • 15
  • 27
KiranGautam
  • 142
  • 1
  • 11
  • Possible duplicate of [find elements inside forms and iframe java selenium webdriver](http://stackoverflow.com/questions/24247490/find-elements-inside-forms-and-iframe-java-selenium-webdriver) – JeffC Oct 04 '15 at 21:35

2 Answers2

0

It finally worked for me like this...

    WaitTool.waitForElementPresent(driver, By.xpath("//iframe[contains(@title,'Rich Text Editor, scDescription_0')]"), 10);

    WebElement iframe = driver.findElement(By.xpath("//iframe[contains(@title,'Rich Text Editor, scDescription_0')]"));

    driver.switchTo().frame(iframe);

            WebElement itemdescription = driver
            .findElement(By.xpath("//body[@class='cke_editable cke_editable_themed cke_contents_ltr']"));
    itemdescription.sendKeys(description);
    driver.switchTo().defaultContent();
    return driver;

Is there any other solutions?

KiranGautam
  • 142
  • 1
  • 11
0

Basically, we can switch over the elements in frames using 3 ways.

By Index
By Name or Id
By Web Element