The website that I am trying to automate has a authentication popup that appears when someone visits it. I tried the following code but Chrome immediately throws no alert present exception on the switchTo() line.
Firefox does not seem to be working. I am currently using Selenium 3.6.0 with the latest binaries of these browsers. Can someone please help me out?
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("https://staging.brightsociety.com/");
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.alertIsPresent());
Alert alert = driver.switchTo().alert();
alert.authenticateUsing(new UserAndPassword(username, password));
driver.switchTo().defaultContent();
