Advanced Stale elements
<p>I have been reading about stale elements and am still a bit confused.  For instance, the following won't work, correct?</p>

<pre><code> public void clickFoo(WebElement ele) {
    try {
      ele.click();
    } catch (StaleElementReferenceException ex) {
      ele.click();
    }
 }
</code></pre>

<p>because if ele is stale, it will remain stale.  The best thing is to redo the driver.findElement(By), but as you can see in this example, there is no xpath.  You can attempt to ele.getAttribute("id") and use that, but if the element has no id, this also will not work.  All methods calling this would have to put the try/catch around it, which may not be feasible.</p>

<p>Is there some other way the element could be refound?  Also, assuming there is an id, would the id remain the same after the element goes stale?  What in the WebElement object ele is different once it goes stale?</p>

<p>(Java Eclipse)</p>