Need some help with Automation Tests

Hi guys,   Been struggling a bit with automation tests. It has been working for the most time. As the tests have gotten bigger and more “complex” I get this error every now and again: org.openqa.selenium.StaleElementReferenceException: The element reference of <some element> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed.   I’m using WebDriverWait to wait for the visibility of the element before clicking or asserting. My tests doesn’t fail at one specific spot, but at random places throughout the test suite.   Thanks Jean    
2 answers

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




Marcel Janssen



Sounds like a though one to resolve. I did find this on stackoverflow: which is suggesting  a workaround by retrying a couple of times. The second answer might be helpful:

new WebDriverWait(driver, timeout)
    .until(new Predicate<WebDriver>() {
        public boolean apply(@Nullable WebDriver driver) {
            return true;

or is that exactly what you have done with webdriverwait already?