try {
WebElement button = driver.findElement(By.xpath("xpath"));
button.click();
}
catch(org.openqa.selenium.StaleElementReferenceException ex)
{
WebElement button = driver.findElement(By.xpath("xpath"));
button.click();
}
This try/catch code actually worked for me. I got the same stale element error.