title: Selenium Webdriver : getText() returning empty String for h2 tag
body: <p>I am having very hard time to get text from <strong>h2</strong> tag. I want <strong>"Product successfully added to your shopping cart"</strong> text.
  My Code : </p>
  
  <pre><code>WebDriver driver = new FirefoxDriver();
  driver.get("http://automationpractice.com");
  .
  .
  .
  System.out.println(driver.findElement(By.xpath("//*[@id='layer_cart']/div[1]/div[1]/h2")).getText());
  </code></pre>
  
  <p>This is following HTML Code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="layer_cart"&gt;&lt;span class="cross" title="Close window"/&gt;&lt;h2&gt;&lt;i class="icon-ok"/&gt;Product successfully added to your shopping cart&lt;/h2&gt;</code></pre>
  </div>
  </div>
  </p>