I'm trying to handle authentication popup using the code below:
WebDriverWait wait = new WebDriverWait(driver, 10);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());
alert.authenticateUsing(new UserAndPassword(**username**, **password**));
When I execute the test, the page shows the authentication popup and cursor is continuously blinking on User Name. And not proceeding further. After 10 seconds I am getting time out exception org.openqa.selenium.TimeoutException
Complete exception: Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out after 10 seconds waiting for alert to be present
I have tried by increasing time out period to 100. Also tried by adding Thread.sleep statement But it wont work