我嘗試使用下面的代碼來處理身份驗證彈出:如何處理身份驗證彈出與硒的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