watir/watir-webdriver — pull request #291 by titusfortner (2014-11-15 00:29:26+00:00)
Title: Improve stale element handling

Element#assert_not_stale as currently implemented is useful for more static interactions with the page (refreshes and the like)
With more dynamic updates to the DOM, we sometimes have elements going stale between the #assert_not_stale call and the wire call that uses the element object.

These updates:
1) Reduce the number of places where wire calls are made directly and push the implementation to the Element superclass where possible.
2) Re-look up the element if it is stale, but still exists. If it passes the #assert_not_stale, then becomes stale, there is no reason to not retry instead of letting the test fail.