Hi Jean,
Have you heard of ATS? It is an add on for the Mendix platform for automating your Test scripts. You can easily record test cases and run than, manually, scheduled or by a external trigger.
ATS has standard wait functions build in for every step you record and run.
If you need more info, check the Mendix Website or contact me directly. I can arrange a short demo
Greetings,
Marcel Janssen
marcel.janssen@mansystems.nl
https://docs.mendix.com/addons/ats-addon/
Sounds like a though one to resolve. I did find this on stackoverflow: https://stackoverflow.com/questions/12967541/how-to-avoid-staleelementreferenceexception-in-selenium#12967602 which is suggesting a workaround by retrying a couple of times. The second answer might be helpful:
new WebDriverWait(driver, timeout)
.ignoring(StaleElementReferenceException.class)
.until(new Predicate<WebDriver>() {
@Override
public boolean apply(@Nullable WebDriver driver) {
driver.findElement(By.id("checkoutLink")).click();
return true;
}
});
or is that exactly what you have done with webdriverwait already?