Attempt to fix the StaleElementReference exceptions
authorThiago H. de Paula Figueiredo <thiago@arsmachina.com.br>
Fri, 23 Nov 2018 19:20:59 +0000 (17:20 -0200)
committerThiago H. de Paula Figueiredo <thiago@arsmachina.com.br>
Fri, 23 Nov 2018 19:20:59 +0000 (17:20 -0200)
tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java

index ab3c0b3..b684895 100644 (file)
@@ -1392,8 +1392,9 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
             {
                 return;
             }
-
-            waitForCondition(ExpectedConditions.attributeToBe(body, "data-page-initialized", "true"), 30);
+            // Attempt to fix StaleElementReferenceException: The element reference of <body> 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
+            // waitForCondition(ExpectedConditions.attributeToBe(body, "data-page-initialized", "true"), 30);
+            waitForCssSelectorToAppear("body[data-page-initialized='true'");
         } catch (NoSuchElementException e)
         {
             // no body element found, there's nothing to wait for