Scenario: search for "Socks for women" on the website and click on the first "Best Seller" Badged item.
I have tried to get the item containers as List<WebElements> and iterate through each element if there is any 'Best-seller' batch exist. I need to get the first found element to click on it. Unfortunately I am stuck with the logic. Any better solutions will be much appreciated.
List<WebElement> elements = driver.findElements(By.cssSelector("div[class*='s-card-container']"));
for(WebElement e : elements) {
// iterate
}