diff --git a/src/org/labkey/test/components/CustomizeView.java b/src/org/labkey/test/components/CustomizeView.java index ebf27949da..212a7590ea 100644 --- a/src/org/labkey/test/components/CustomizeView.java +++ b/src/org/labkey/test/components/CustomizeView.java @@ -390,11 +390,17 @@ private void addItem(CharSequence fieldKey, ViewItemType type) // Expand all nodes necessary to reveal the desired node. WebElement fieldRow = expandPivots(fieldKey); - WebElement checkbox = Locator.css("input[type=button]").findElement(fieldRow); - WebElement rowLabel = Locator.byClass("x4-tree-node-text").findElement(fieldRow); - rowLabel.click(); + WebElement checkbox = Locator.css("input[type=button]").refindWhenNeeded(fieldRow); + + // In some situations calling Checkbox(checkbox).check() doesn't always check the checkbox. Verify that it has + // been checked, and if not try again. ScrollUtils.scrollIntoView(checkbox); new Checkbox(checkbox).check(); + if (!new Checkbox(checkbox).isChecked()) + { + new Checkbox(checkbox).check(); + } + itemXPath(type, fieldKey).waitForElement(this, 2_000); } diff --git a/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java b/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java index 55b727db29..42fc0dc958 100644 --- a/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java +++ b/src/org/labkey/test/components/ui/notifications/ServerNotificationMenu.java @@ -198,7 +198,7 @@ private WebElement waitForNotificationList() // Find the container again, don't return listContainer WebElement previously found. If the list was slow to // update with the most recent notification the old reference will be stale. - return notificationsContainerLocator.waitForElement(elementCache().menuContent, 1_000); + return notificationsContainerLocator.refindWhenNeeded((elementCache().menuContent)); } /**