我尝试使用下面的代码来处理身份验证弹出:如何处理身份验证弹出与硒的webdriver在Java中
WebDriverWait wait = new WebDriverWait(driver, 10);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());
alert.authenticateUsing(new UserAndPassword(**username**, **password**));
当我执行测试,页面显示的验证弹出和光标不停闪烁在用户名上。而不是继续进行。 10秒后我收到超时异常org.openqa.selenium.TimeoutException
完全例外: 异常线程“main” org.openqa.selenium.TimeoutException:10秒等待警报后超时在场
我已经通过增加超时期限为100 还试图尝试加入了Thread.sleep声明 但它不会工作
请尝试driver.switchTo()。alert()。authenticateUsing(..)并检查。 –
重复[this](http://stackoverflow.com/questions/11522434/how-to-handle-login-pop-up-window-using-selenium-webdriver) – MikeJRamsey56