I'm working on a project where wanted to 1. Scroll the web page. 2. links are stored in the table 3. Click on the link present in the row
((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
List<WebElement> req = driver
.findElements(By.xpath("//table[@class='forceRecordLayout uiVirtualDataGrid--default uiVirtualDataGrid forceVirtualGrid resizable-cols']//tr"));
int total_req = req.size();
System.out.println(total_req);
for (int i = 0; i < total_req; i++) {
String reqToClick = req.get(i).getText();
if (reqToClick.equalsIgnoreCase("UPC_ 762016_Product Test- 06-07-2016 0")) {
Thread.sleep(3000);
req.get(i).click();
Thread.sleep(3000);
break;
}
}
Above is the code where I'm storing data into the list, but the page is not scrolling down. List says showing count without scroll. Please help me out.