我试图在导航到Facebook后插入5/10秒的时间延迟,但这不起作用:
public FacebookLoginPage clickSignInWithFacebook() {
WebElement facebookBtn = waitForElementDisplay(loginPageObjects.signInWithFacebookBtn);
facebookBtn.click();
TimeUnit.SECONDS.sleep(5);
return FacebookLoginPage.getInstance();
答案 0 :(得分:0)
https://docs.oracle.com/javase/tutorial/essential/concurrency/sleep.html
Thread.sleep(milliseconds);
所以对你的情况来说:
Thread.sleep(5000);