How do I scroll to a specific element and click on it?
Below is the code which I have tried:
Random R = new java.util.Random();
List<WebElement> Top_Stores =driver.findElements(By.xpath(".//*[@id='go_body']/main/section/div/div[2]/div/div/div[2]/aside/div[1]/section[1]/a"));
WebElement randomElement = Top_Stores.get(R.nextInt(Top_Stores.size()));
String S=randomElement.getText();
System.out.println(S);
Actions actions = new Actions(driver);
actions.moveToElement(randomElement);
actions.perform();
randomElement.click();