From e2b6798aa3d9b055aec3480ed4320a70ec7475a2 Mon Sep 17 00:00:00 2001 From: Trey Chadick Date: Wed, 3 Dec 2025 10:22:37 -0800 Subject: [PATCH] Fix another stale element exception on panorama dashboard (#588) --- .../PanoramaPublicMyDataViewTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java index 5833d33d..3db85dd9 100644 --- a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java +++ b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicMyDataViewTest.java @@ -85,7 +85,7 @@ public void testMyDataView() // Sign out. Guest should not be able to see the "My Data" button simpleSignOut(); goToProjectHome(PANORAMA_PUBLIC); - var table = new DataRegionTable.DataRegionFinder(getDriver()).refindWhenNeeded(); + var table = findPanoramaPublicExperimentsDataRegion(); assertFalse(table.hasHeaderMenu("My Data")); simpleSignIn(); @@ -192,12 +192,17 @@ private void verifyColumnValues(DataRegionTable table, int catalogEntryCol, int @NotNull private DataRegionTable myDataView() { - // The "Panorama Public Search" webpart re-renders the "Targeted MS Experiment List" webpart with a different - // title which can cause a StaleElementReferenceException. Find the dataregion by the updated webpart title. - var table = new DataRegionTable.DataRegionFinder(getDriver()) - .find(WebPartPanel.WebPart(getDriver()).withTitle("Panorama Public Experiments").waitFor()); + var table = findPanoramaPublicExperimentsDataRegion(); assertTrue(table.hasHeaderMenu("My Data")); table.clickHeaderButtonAndWait("My Data"); return new DataRegionTable.DataRegionFinder(getDriver()).refindWhenNeeded(); } + + // The "Panorama Public Search" webpart re-renders the "Targeted MS Experiment List" webpart with a different + // title which can cause a StaleElementReferenceException. Find the dataregion by the updated webpart title. + private DataRegionTable findPanoramaPublicExperimentsDataRegion() + { + return new DataRegionTable.DataRegionFinder(getDriver()) + .find(WebPartPanel.WebPart(getDriver()).withTitle("Panorama Public Experiments").waitFor()); + } }