samedi 10 mars 2018

Why isn't my click event not working in Selenium?

When clickevent is fired, I want it to redirect/open new page in same tab. The new tab would be '/Waiting', however even after click event is fired, it stays in the same page. While doing manually by going to browser's localhost, it works though. Also, even after 10 secs, it doesn't load.

@Test
public void firstPlayerConnection() {
    try {
        driver.get(uiPath);
        WebElement startGame = driver.findElement(By.id("startGame"));
        startGame.click();
        WebElement gif = (new WebDriverWait(driver, 10))
                .until(ExpectedConditions.presenceOfElementLocated(By.id("loading")));
        assertEquals("/Waiting", driver.getCurrentUrl());

    } finally {
        driver.quit();
    }
}

Aucun commentaire:

Enregistrer un commentaire