Estou tendo problemas na execução dos timouts. Eu criquei a seguinte Clase: LoGinPage:
package email;
import java.time.Duration; import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver.Timeouts; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import PageObject.PageObject;
public class LoginPage extends PageObject{
private static final String URL_LOGIN = "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=13&ct=1637089048&rver=7.0.6737.0&wp=MBI_SSL&wreply=https%3a%2f%2foutlook.live.com%2fowa%2f%3fnlp%3d1%26RpsCsrfState%3d2e23c3a8-3811-50f4-e7dd-889c925b8653&id=292841&aadredir=1&CBCXT=out&lw=1&fl=dob%2cflname%2cwld&cobrandid=90015";
public LoginPage() {
super(null);
browser.get(URL_LOGIN);
}
public void preencheFormularioDeLogin(String email, String senha) {
this.browser.findElement(By.name("loginfmt")).sendKeys(email);
this.browser.findElement(By.id("idSIButton9")).click();
this.browser.findElement(By.name("passwd")).sendKeys(senha);
this.browser.manage().timeouts().implicitlyWait(55, TimeUnit.SECONDS);
this.browser.findElement(By.id("idSIButton9")).click();
this.browser.findElement(By.id("idBtn_Back")).click();
this.browser.get("https://outlook.live.com/mail/0/inbox");
}
}
Ao executar, ele finaliza antes mesmo do botão id idSIButton9 ficar visível novamente, ao invés de aguardar 5 segundos conforme informei no timeout.
O que devo fazer neste cenário?