title: Selenium Firefox/Web-Driver can't find element by XPath
body: <p>I'm having trouble reading a link inside a div.
  Ok, here's what the div looks like:</p>
  
  <pre><code>&lt;div id="AjaxStream" style="clear: both"&gt;
  &lt;a target="_blank" href="http://www.something.com/"&gt;
  &lt;img height="370" width="752" border="4" usemap="#Link" src="somefile.png"&gt;
  &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The following code, to find the div works perfectly fine. 
  (I tried element.getAttribute("id") - which returned "AjaxStream")</p>
  
  <pre><code>WebElement element = river.findElement(By.xpath("//html/body/div/div[2]/div/div[11]"));
  </code></pre>
  
  <p>And here is what's not working:</p>
  
  <pre><code>WebElement element = driver.findElement(By.xpath("//html/body/div/div[2]/div/div[11]/a"));
  </code></pre>
  
  <p>This should actually fine the link-element, but it doesn't. Any ideas?
  Thanks in advance.</p>
  
  <p><strong>##Edit:</strong>
  Nevermind - I fixed it. The problem was that the element wasn't loaded. I added a Thread.sleep(1000) before trying to find the element - and now it works perfectly fine.</p>