I have a list of webelements, I have written the below code:
List <WebElement> feature_tiles = driver.findElements(By.xpath("//div[contains(@class,'featuretile')]//a"));
System.out.println("" +feature_tiles.size() );
for(int i=0; i<feature_tiles.size();i++)
{
double x = feature_tiles.get(i).getLocation().getX();
double y = feature_tiles.get(i).getLocation().getY();
JavascriptExecutor javScriptExecutor = (JavascriptExecutor) driver;
javScriptExecutor.executeScript("window.scrollBy(" + x + ", " + y + ");")
}
what I want to do is, scroll to that particular element and wait for it to load and also take a screen shot, of the individual elemetns.
Current is scrolling to the elements even if the images of the elements is not loaded correctly.