package com.agile611.testng.webdriver;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

public class DisappearingElementsTest extends BaseTest {

    @Test
    public void testApp() throws InterruptedException {
        driver.navigate().to("https://the-internet.herokuapp.com/disappearing_elements");
        for (int i = 0; i < 10; i++) {
            System.out.println("Iteración: " + (i + 1));
            WebElement elementsDelMenu =
                    driver.findElement(
                            By.xpath(".//*[@id='content']/div/ul/li[last()]"));
            elementsDelMenu.click();
            driver.navigate().to("https://the-internet.herokuapp.com/disappearing_elements");
            driver.navigate().refresh();
        }
    }
}