I'm a little dumbfounded by an issue I've been having for a few days now. I keep getting stale element exception from areas in the test in which everything worked flawless before. Even though I presumed that it's due to a slow server I'm running these tests on, unfortunately I am not able to switch or run these tests locally.
Here is a snippet used to mediate the stale element exception. This snippet stopped the process from ending/crashing in a stale element exception, but it won't leave the loop, and my console keeps printing the fact that indeed, there is stale element exception.
Any input is greatly appreciated. Also, if indeed my issue is server side, what workarounds can be implemented?
public void checkSomething() {
SomeClass someClass = new SomeClass()
for(int x = start; x <= end; start++) {
//ignore for loop, it just iterates through a list
boolean staleElement = true;
while (staleElement) {
try {
someClass = new SomeClass()
staleElement = false
veriThis()
andVerifyTheOther()
}
catch (StaleElementReferenceException ex) {
println "Stale Element = " + cell
println ex.getStackTrace()
}
}
}