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.
This is a sample testing page - view with a single element. The list items <li> load dynamically from the server and are bounded by Angular.
<div id="items">
<li>text</li>
<li>text2</li>
</div>
I'm trying to pass a test and there is an error in this line:
_driver.FindElements(By.TagName('li'))
At this point, there are no loaded elements and //_driver.PageSource doesn't contain elements.
How can I wait for the items to load? Please do not suggest Thread.Sleep()