I want to scroll the page ((JavascriptExecutor)driver) in selenium.but its not scroll its will shows the array index out of bound exception
driver.get("https://www.justdial.com/Coimbatore");
((JavascriptExecutor)driver).executeScript("scroll(0,500)");
List<WebElement> d=driver.findElements(By.className("store-name"));
System.out.println(d.size());
for(int i=0;i<=d.size();i++){
System.out.println(d.get(i).getText());
}