Open Jacobvu84 opened 5 years ago
When you want to verify the expected item have exist in the list. This is the way to collect all items to List ( java 8+)
public class SearchResultsPage extends PageObject { @FindBy(css=".listing-card") List<WebElement> listingCards; public List<String> getResultTitles() { return listingCards.stream() .map(element -> element.getText()) .collect(Collectors.toList()); } }
Jacob Vu khóa học Selenium WebDriver online cho cá nhân
When you want to verify the expected item have exist in the list. This is the way to collect all items to List ( java 8+)
Jacob Vu khóa học Selenium WebDriver online cho cá nhân