From 2515927bcaf9e4906a84f76af81ac26a35416a0c Mon Sep 17 00:00:00 2001 From: Daria Bodiakova <70635654+DariaBod@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:57:43 -0700 Subject: [PATCH] add retry for 'View all activity' click --- .../notifications/ServerNotificationMenu.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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()); }