How to use sendKeys into ckeditor text area using java selenium
<h2>How can I send keys to Reach text area in java selenium.</h2>

<h2>Here is the HTML code include Iframe:</h2>

<pre><code>&lt;div class="col-sm-11"&gt;
&lt;textarea class="ckeditor ng-untouched ng-empty ng-invalid ng-invalid-required ng-dirty ng-valid-parse" ng-class="{true:'validation-error'}[submitted]" placeholder="Enter text ..." ck-editor="" ng-model="NewTicket.Message" name="Message" style="visibility: hidden; display: none;" aria-invalid="true"/&gt;
&lt;div id="cke_Message" class="cke_1 cke cke_reset cke_chrome cke_editor_Message cke_ltr cke_browser_gecko" lang="en" aria-labelledby="cke_Message_arialbl" role="application" dir="ltr"&gt;
&lt;span id="cke_Message_arialbl" class="cke_voice_label"&gt;Rich Text Editor, Message&lt;/span&gt;
&lt;div class="cke_inner cke_reset" role="presentation"&gt;
&lt;span id="cke_1_top" class="cke_top cke_reset_all" style="height: auto; -moz-user-select: none;" role="presentation"&gt;
&lt;div id="cke_1_contents" class="cke_contents cke_reset" role="presentation" style="height: 200px;"&gt;
&lt;span id="cke_50" class="cke_voice_label"&gt;Press ALT 0 for help&lt;/span&gt;
&lt;iframe class="cke_wysiwyg_frame cke_reset" frameborder="0" src="" style="width: 100%; height: 100%;" title="Rich Text Editor, Message" aria-describedby="cke_50" tabindex="0" allowtransparency="true"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;span class="ng-binding ng-hide" style="color:red" ng-show="newTicketForm.Message.$invalid &amp;&amp; submitted" aria-hidden="true"&gt;Content is required&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p><em>I try to use below method using Iframe class name but I couldn’t send data to it. Here is the Selenium code</em></p>

<pre><code>for (String handle002 : driver.getWindowHandles()) 
    {
        driver.switchTo().window(handle002);
        Thread.sleep(500);
          for (String handle001 : driver.getWindowHandles()) 
            {
    driver.switchTo().window(handle001);
    Thread.sleep(500);
  driver.switchTo().frame(driver.findElement(By.className("cke_wysiwyg_frame cke_reset")));
  driver.switchTo().defaultContent();
  WebElement body=driver.findElement(By.className("cke_wysiwyg_frame cke_reset"));
  body.sendKeys("Test");
  driver.switchTo().defaultContent();
            }
    }
</code></pre>

<p><a href="https://i.stack.imgur.com/2aXR9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2aXR9.png" alt="enter image description here"></a></p>