title: Testing AngularJS with Selenium
body: <p>I have a SPA application on stack ASP MVC + AngularJS and I'd like to test the UI.
  For now I'm trying Selenium with PhantomJS and WebKit drivers.</p>
  
  <p>This is a sample testing page - view with single element. The list items <code>&lt;li&gt;</code> load dynamically from server and are bounded by Angular.</p>
  
  <pre><code>&lt;div id="items"&gt;
      &lt;li&gt;text&lt;/li&gt;
      &lt;li&gt;text2&lt;/li&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm trying to pass a test and there is an error in this line:</p>
  
  <pre><code>_driver.FindElements(By.TagName('li'))
  </code></pre>
  
  <p>At this point there are no loaded elements and _driver.PageSource doesn't contain elements.</p>
  
  <p>How can I wait for the items to load? Please do not suggest <code>Thread.Sleep()</code></p>