title: How to type gmail body text in selenium webdriver
body: <p>I am able to successfully compose the email but after adding subject of the mail..I am not able to find any element <code>Xpath</code> or <code>id</code> or <code>className</code> to type the body of the mail..</p>
  
  <p>I used:- <strong>Type (send keys) the email content to the editable div: "//div[@class='gmail_default']" (or "//div[@aria-label='Message Body']")</strong> for the Gmail body text.. </p>
  
  <pre><code> driver.findElement(By.xpath("//div[@aria-label='Message Body']")).sendKeys("This is the test email send to test the selenium script.");
  </code></pre>
  
  <p>it worked once..after that it stopped working.</p>
  
  <p>Please can anyone help...
  ******************Code**********************</p>
  
  <pre><code>public class TestSelenium {
  public static void main(String[] args) throws InterruptedException{
  
     System.setProperty("WebDriver.gecko.driver", "C:\\Users\\Administrator\\geckodriver-v0.14.0-win64\\geckodriver.exe");
  
      FirefoxDriver driver = new FirefoxDriver();
      driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
      driver.get("http://www.gmail.com/");
  
      driver.manage().window().maximize();
      WebElement id =driver.findElement(By.xpath(".//*[@id='Email']"));
      id.click();
      id.sendKeys("Email");
      WebElement next = driver.findElement(By.xpath(".//*[@id='next']"));
      next.click();
      WebElement psw = driver.findElement(By.id("Passwd"));
      psw.clear();
      psw.sendKeys("Password");
  
      driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
      WebElement login = driver.findElement(By.xpath(".//*[@id='signIn']"));
      login.click();
      WebElement compose = driver.findElement(By.xpath(".//*[@id=':44']/div/div"));
      compose.click();
      WebElement to = driver.findElement(By.className("vO"));
      to.sendKeys("Email_id of Receiver");
      WebElement sub = driver.findElement(By.className("aoT"));
      sub.sendKeys("Login Successful");
      driver.findElement(By.xpath("//div[@aria-label='Message Body']")).sendKeys("This is the test email send to test the selenium script.");
  
      WebElement send = driver.findElement(By.xpath(".//*[@id=':8m']"));
      send.click();
  </code></pre>
  
  <p>}
  }</p>