How To Handle IE Setup Popup in Selenium
Asked Answered
A

1

0

how to handle IE set up in selenium click image for alert popup enter image description here

Anselme answered 15/3, 2019 at 9:18 Comment(2)
Did you tried following capability set up to ignore this popup capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);Pontoon
I have tried all below listed but not working capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false); capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); capabilities.setCapability("allow-blocked-content", true); capabilities.setCapability("allowBlockedContent", true); capabilities.setCapability("unexpectedAlertBehaviour", "accept"); capabilities.setCapability("ignoreProtectedModeSettings", true); capabilities.setCapability("disable-popup-blocking", true);Anselme
B
0

You can try to accept the alert via selenium. The following Java method should accept the alert and let you move on with your life.

public void checkAlert() 
{
    try 
    {
        // Wait for the alert to show
        WebDriverWait wait = new WebDriverWait(driver, 2);
        wait.until(ExpectedConditions.alertIsPresent());

        driver.switchTo().alert().accept();

    } 
    catch (Exception e) 
    {
        //exception handling
    }
}

You'll want to add import org.openqa.selenium.Alert; to your imports too.

Barbicel answered 24/3, 2019 at 2:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.