title: HtmlUnitDriver click and wait for reloading element
body: <p>My question is how can I perform click on element to get data from server response?
  Algorithm:<br>
  <strong>1)</strong> Click on div element</p>
  
  <pre><code>&lt;div class="contact-button link-phone {'path':'phone', 'id':'z8rpg', 'id_raw': '519183738'} atClickTracking contact-a" data-rel="phone"&gt; 
      &lt;i data-icon="phone"&gt;&lt;/i&gt; 
      &lt;strong class="xx-large"&gt; TEXT1 &lt;/strong&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>2)</strong> Sending request to server<br>
  <strong>3)</strong> Server sends response with modified text.
  So I need to get that modified text(TEXT1 in code). I have done it like this :</p>
  
  <pre><code>HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.CHROME);
          driver.get("https://www.olx.ua/obyavlenie/audi-a4-1998-IDzaH8c.html#c890172227;promoted");
          System.out.println("Title: " + driver.getTitle());
          WebElement webElement = driver.findElement
                  (By.xpath("//*[@id=\"contact_methods\"]/li[2]/div"));
          webElement.click();
          Thread.sleep(3000);
          webElement = driver.findElement
                  (By.xpath("//*[@id=\"contact_methods\"]/li[2]/div"));
          phone = webElement.getText();
  </code></pre>
  
  <p><strong>UPDATE</strong>  :</p>
  
  <p>As I understand, after getting response from server div element is reloading, not whole page.
  I need to wait until div element finish reloading.
  Using debug mode I noticed strange thing. In this line:</p>
  
  <pre><code>phone = webElement.getText();
  </code></pre>
  
  <p>State of webElement: readyState_ = "loading"</p>