title: Selenium: How to locate dynamic element like notification messages
body: <p>I am using Selenium with Web Driver.</p>
  
  <p>I have a form to be filled up in a Light Box. Now when I click "submit". That Light Box gets closed and an easy notification gets generated on top of the page which gets disappeared after a couple of sec.</p>
  
  <p>Now my question is: When I do </p>
  
  <pre><code>driver.findElement(By.xpath(".//*[@id='createCaseBtn']")).click(); // x-path of submit button
  </code></pre>
  
  <p>How shall I check whether that notification message appeared on the UI. </p>
  
  <p>Because when I do </p>
  
  <pre><code>driver.findElement(By.xpath(".//*[@id='easyNotification']")).getText(); // x-path of easyNotification message
  </code></pre>
  
  <p>I shows me that it is Unable to locate the element which seems logically correct because at that time the notification message is not present on the UI. It is only after completion of AJAX Request (for submition of form) that message gets appeared on the UI.</p>
  
  <p>Please help!!!!</p>
  
  <p>Thanks</p>