3

I am having issues detecting Basic Auth alert with ChromeDriver 2.14 (Chrome 40.0.2214.111 (64-bit)); I am instantiating the driver like this:

new ChromeDriver(DesiredCapabilities.chrome());

and then navigate and wait for pop up:

    driver.navigate().to(URL);
    WebDriverWait wait = new WebDriverWait(driver, 10);
    Alert alert = wait.until(ExpectedConditions.alertIsPresent());
    alert.authenticateUsing(new UserAndPassword("test", "test"));

But it times out after 10 seconds with the error message no alert open. I can see that there is an alert open for basic auth.

Can you see anything wrong with the code or is it a bug with the driver?

I have seen some old question relating to a chromedriver bug. I haven't seen any other question relevant.

Thank you for your help.

gdiamantidis
  • 102
  • 3
  • 10

1 Answers1

-1

Your question is similar to this question here

Authentication popup is NOT generated by Javascript / it is not a javascript alert. So It can not be handled by WebDriver. So the above behavior is expected.

Below authenticateUsing a beta method is not yet implemented.

alert.authenticateUsing(new UserAndPassword("test", "test"));
Community
  • 1
  • 1
vins
  • 15,030
  • 3
  • 36
  • 47