title: Webdriver getText() of an element returns blank
body: <p>I have an element with a dynamic number. It's a unique order number that gets generated after every order. I am trying to fetch that number from a paragraph, <code>&lt;p&gt;</code> tag using the getText() method, but webdriver returns a blank text after the test is run.</p>
  
  <p>Executing :</p>
  
  <pre><code>boolean a = driver.findElement(By.xpath("(.//*[@id='alert-message']/div/p/strong)[1]")).isDisplayed();
  </code></pre>
  
  <p>returns false, suggesting the element is not displayed.</p>
  
  <p>This is the HTML:</p>
  
  <pre><code>&lt;div class="ng-scope" ng-include="templates[step]"&gt;
  &lt;div class="ng-scope" ng-controller="wReviewCtrl"&gt;
  &lt;div class="panel-alert ng-hide" ng-show="success&lt;0"&gt;
  &lt;div class="panel-alert" ng-show="success&gt;0 &amp;&amp; hasRole('BUYER')"&gt;
  &lt;div class="alert-wrap in"&gt;
  &lt;div id="alert-message" class="alert alert-success" role="alert"&gt;
  &lt;div class="media"&gt;
  &lt;strong&gt;Done!&lt;/strong&gt;
  &lt;p&gt;
  A new order with Number
  &lt;strong class="ng-binding"&gt;JJ-MD000-12345&lt;/strong&gt;  //Order number
   was generated. The order is now complete.
  &lt;/p&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="panel-alert ng-hide" ng-show="success&gt;0 &amp;&amp; hasRole('SELLER')"&gt;
  &lt;div class="alert-wrap in"&gt;
  &lt;div id="alert-message" class="alert alert-success" role="alert"&gt;
  &lt;div class="media"&gt;
  &lt;strong&gt;Done!&lt;/strong&gt;
  &lt;p&gt;
  </code></pre>
  
  <p>I tried getting text using:</p>
  
  <pre><code>String orderNo = driver.findElement(By.xpath("(.//*[@id='alert-message']/div/p/strong)[1]")).getText();
  System.out.println(orderNo);
  </code></pre>
  
  <p>I have tried all sorts of alternative combinations instead of <code>.getText()</code> including:</p>
  
  <pre><code>.getAttribute("textContent");
  .getAttribute("innerHTML");
  .getAttribute("value");  //retuns NULL value
  .getAttribute("outerText");
  </code></pre>
  
  <p>But none of them worked. How can I get that order number in the HTML?</p>