I have an HTML page that is using Knockout.js to populate some list.
An item is added to the list when I click a button.
I write Selenium WebDriver test:
- I find the button, then click on it.
- Then I find the new element.
- Then I test the text of the new element.
I get a stale element exception.
If I wait after the click (paused in debugger, or adding a Thread.Sleep of about 500ms) the test passes.
How can I make sure the element I find isn't stale? Is there a property given to me by WebDriver I can test for that?