I need to know how to store the first 10 values in List<WebElement>
instead of storing all the elements that is present?
Right now my code stores all the elements:
By mySelector = By.xpath("/html/body/div[1]/div/section/div/div[2]/form[1]/div/ul/li");
List<WebElement> myElements = driver.findElements(mySelector);
for(WebElement e : myElements) {
System.out.println(e.getText());
}