/**
* @param resultPage
* @return
*/
protected boolean checkPager(GridResultPage gridPage,String[] rows) {
GridPagerPage gridPager = gridPage.getGridPager();
//If paging is available
if (gridPager.canPageNext()){
gridPager.nextPage();
//wait for the page number to change
waitForText("/html/body/div[3]/div/div/div[2]", 5, "5 - 10");
// wait for the rows of the grid to load after changing page
waitForChildren("table", "tbody/tr[5]", 10);
} else {
return true;
}
//Check that the results of the grid have changed
boolean nextPageLinkIsWorking = true;
List<WebElement> rowsAfterNextPageWasClicked = gridPage.getTableRows();
for(int i=0;i<rowsAfterNextPageWasClicked.size();i++){
//if the set of rows in page 2 is different than the set of rows in page 1
//then the pager is working. - if the rows do not change, then pager is not working
//System.out.println(rows[i]+" == "+rowsAfterNextPageWasClicked.get(i).getText());
if(rows[i].equals(rowsAfterNextPageWasClicked.get(i).getText())){
Assert.fail("Same row after paging next " + rows[i] + " == " + rowsAfterNextPageWasClicked.get(i).getText());
nextPageLinkIsWorking = false;
}
}
//If we can move back a page
if (gridPager.canPagePrevious()){
//move back to the first page
gridPager.previousPage(gridPage);
//wait to go back to page 1
waitForText("/html/body/div[3]/div/div/div[2]", 5, "0 - 5");
//wait for the rows of the grid to load after changing page
waitForChildren("table", "tbody/tr[5]", 5);
} else {