Skip to content

Commit

Permalink
Pager: try to fix getPageSize locators
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-alan committed Jan 22, 2024
1 parent 7f6e80b commit f819601
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/org/labkey/test/components/ui/Pager.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ public int getPageSize() // only works on GridPanel
// Changing the jumpToDropdown button from the deprecated DropdownButtonGroup class to a MultiMenu type has changed
// the way that various text from the control is gathered. Getting the current page size now requires that the dropdown
// be expanded and the selected page size found in the list.

elementCache().jumpToDropdown.expand();

// Find the selected li element in the page size list (//div[@class='grid-panel__button-bar']//ul[contains(@aria-labelledby,'current-page-drop')]//li[@class='active'])
WebElement activeLi = Locator.tagWithAttributeContaining("ul", "aria-labelledby", "current-page-drop").childTag("li").withAttribute("class", "active").findElement(this);
// Find the selected li element in the page size list
WebElement activeLi = Locator.byClass("active").findElement(elementCache().jumpToDropdown);

int size = Integer.parseInt(activeLi.getText());
elementCache().jumpToDropdown.collapse();
Expand Down

0 comments on commit f819601

Please sign in to comment.