Posts

Showing posts from February, 2021

How to authenticate alert popup using Selenium

Image
  Solution : Use the following code. Example is given in using Firefox. String url = "https://dev20.***********.com/************"; String username = "s*****"; String password = "e******"; System.setProperty("webdriver.gecko.driver", "Geckodriver\\v0.21.0-win64\\geckodriver.exe"); WebDriver   driver = new FirefoxDriver(); String urlTemp = url.replaceFirst("https://", ""); String URL = "https://" + username  + ":" + password + "@" + urlTemp; driver.get(URL); ............................................................................................................... My failed attempt  #01: The following code didn't for me & provide Error:    "org.openqa.selenium.UnsupportedCommandException: POST /session/ef0fb2c1-e4c1-4d63-bab7-6a8fbe03af8b/alert/credentials did not match a known command" String url = "https://dev20.***********.com/************"; Stri