I am trying to automate myntra.com Under the Men category, Inside Fashion accessories, select Phone Cases. After clicking Phone Cases, i want to select 3rd row 1st item but these images are dynamically changing. so how to select 3rd row 1st item after changing an image.
Code is:
Actions actions = new Actions(driver);
WebElement menTab = driver.findElement(By.xpath("//a[text()='Men']"));
actions.moveToElement(menTab).perform();
WebElement phonecaseTab = driver.findElement(By.xpath("//*[@id="desktop-header-cnt"]/div[2]/nav/div/div[1]/div/div/div/div/li[5]/ul/li[11]/a"));
new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(phonecaseTab));
actions.moveToElement(phonecaseTab).click().perform();
driver.findElement(By.xpath("//img[contains(@title,'CelfieDesign Turquoise Blue & Black')]")).click();