diff --git a/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java b/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java index 42fc0dc958..df15d06eb1 100644 --- a/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java +++ b/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java @@ -5,6 +5,7 @@ import org.labkey.test.components.Component; import org.labkey.test.components.WebDriverComponent; import org.labkey.test.components.ui.pipeline.ImportsPage; +import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.StaleElementReferenceException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; @@ -157,10 +158,19 @@ public void clickMarkAll() public ImportsPage clickViewAll() { - expand(); - WebDriverWrapper.waitFor(elementCache().viewAllLink()::isDisplayed, - "View all link did not become visible.", 2_500); - elementCache().viewAllLink().click(); + // Retry for clicking 'View all activity' link because of stale element. + WebDriverWrapper.waitFor(() -> { + try + { + expand(); + elementCache().viewAllLink().click(); + return true; + } + catch (StaleElementReferenceException | NoSuchElementException retry) + { + return false; + } + }, "View all link did not become clickable.", 5_000); return new ImportsPage(getWrapper()); }