I have a method where i have taken the rowcount of 10 records on page load and 15 records after changing the page no to 15 question here is how to validate by creating a Assert method seperatly in order to validate the count
Below is my method:
public void pagenation()
{
List<WebElement> noofrowbefore = driver.findElements(By.xpath("//table/tbody/tr/td[1]/p"));
int beforecount = noofrowbefore.size();
for(int i=0;i<noofrowbefore.size();i++)
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("window.scrollBy(0,2500)");
elementInteraction.onClick(pagedropdown);
wait.until(ExpectedConditions.visibilityOfElementLocated(pagenumberselection));
elementInteraction.onClick(pagenumberselection);
//after selecting the pagenumber need to validate the number of records in the grid
List<WebElement> noofrowAfter = driver.findElements(By.xpath("//table/tbody/tr/td[1]/p"));
int aftercount = noofrowAfter.size();
}
Any inputs..