enter image description hereThrough first URL, I click on login (as shown in Image) which leads to another URL where I need to enter the credentials. But before that page I see a pop up generated from the browser which cannot be located by Selenium. enter image description here. The version of my chrome browser is Version 61.0.3163.100 (Official Build) (64-bit)
I tried using the following methods:
Alert.dismiss()
JavaScript
((JavascriptExecutor) driver).executeScript("window.confirm = function(msg) { return
true; }");
AutoIt
WinWaitActive("Windows Security") Send("admin{TAB}") Send("Password{Enter}")
Robot class
alert.sendKeys("UserName"); Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); alert.sendKeys("Password"); alert.accept();
Also tried to navigate through second URL by entering the Username and Password within the URL
Along with this also used some of the Chrome options in my selenium script
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-popup-blocking");
options.addArguments("chrome.switches","--disable-extensions");
driver = new ChromeDriver(options);
ChromeOptions options = new ChromeOptions();
options.addArguments("test-type");
options.addArguments("disable-popup-blocking");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
driver = new ChromeDriver(capabilities);
WebDriverWait wait = new WebDriverWait(driver, 10);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());
alert.authenticateUsing(new UserAndPassword(username, password));
Is there any other way to remove this popup within chrome settings or through script?
Thanks in Advance