Friday, 2 August 2019

what is stale element exception - how to fix it


Stale = left over / old

if an element changes its position and then if you are trying to perform some event on top of it then we get stale element exception.

below are the fixes

wait.until(ExpectedConditions.visiblityofElementToBeClickable(By.id(“id”)))

wait.until(ExpectedConditions.presenceOfElementLocated(By.id("id")));

wait.until(ExpectedConditions.refreshed(ExpectedConditions.stalenessOf("table")));

No comments:

Post a Comment