title: Element not found error in Selenium Webdriver
body: <p>HTML Code :</p>
  
  <pre><code> &lt;table border="0" width="100%" cellspacing="0" cellpadding="2"&gt;  
      &lt;tr class="messageStackError"&gt;
      &lt;td class="messageStackError"&gt;
      &lt;img src="images/icons/error.gif" border="0" alt="Error" title=" Error  "/&gt;&amp;nbsp;
      Error: Invalid administrator login attempt.&lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>Selenium Code :</p>
  
  <pre><code>String message =driver.findElement(By.className("messageStackError")).getText();
  </code></pre>
  
  <p>I am getting the run time error in Selenium webdriver</p>
  
  <blockquote>
    <p>Unable to locate element: .messageStackError (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 19 milliseconds
    For documentation on this error, please visit: <a href="http://seleniumhq.org/exceptions/no_such_element.html" rel="nofollow">http://seleniumhq.org/exceptions/no_such_element.html</a></p>
  </blockquote>