title: Selenium Java-Unable to get text from the webpage element
body: <p>Webpage i am automating: <a href="https://app.ghostinspector.com/account/create" rel="nofollow">https://app.ghostinspector.com/account/create</a></p>
  
  <p>Scenario: I am clicking on the signup page and entering details and clicking on the register button, now if user passes a same email address the message "E-mail address is already in use." is displayed on the website so what i am trying to do is that locate the text message clear it and enter another email address at runtime. </p>
  
  <p>Now the problem is that the error message text is not fetched by the gettext method of selenium.</p>
  
  <p>Below is the code:</p>
  
  <pre><code> WebElement email_in_use = driver.findElement(
      By.xpath("/html/body/div[1]/div/div/div[2]/form/div/div[1]"));
      String message = email_in_use.getText();    
      System.out.println(message);
  </code></pre>
  
  <p>Let me know whats the problem here.</p>