How do I enable/disable popups in Internet Explorer?

How do I enable/disable popups in Internet Explorer?

Hello Tom-dale,

We can use the capability popups as true/false.

WHat is the capability name for INternetExplorer? @LambdaTest

Hi Manny,

Here’s the code snippet to enable all pop-ups in Safari or IE for desktop devices:

EdgeOptions options = new EdgeOptions();
    Map<String, Object> prefs = new HashMap<String, Object>();
    Map<String, Object> profile = new HashMap<String, Object>();
    Map<String, Object> contentSettings = new HashMap<String, Object>();
    // SET EDGE OPTIONS
    // 0 - Default, 1 - Allow, 2 - Block
    contentSettings.put("notifications", 1);
    profile.put("managed_default_content_settings", contentSettings);
    prefs.put("profile", profile);
    options.setExperimentalOption("prefs", prefs);

this is for Edge or IE?

My Use Case is to Run in INternet Explorer Mode in EDGE Browser.

not in Generic Edge Browser ALone.

So Im using following options

capabilities = new DesiredCapabilities(); capabilities.setAcceptInsecureCerts(false); capabilities.setBrowserName(“internet explorer”); capabilities.setCapability(“ie.edgechromium”, true); capabilities.setCapability(“ie.edgepath”, “C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe”); ieOptions = new InternetExplorerOptions(); ieOptions.setPlatformName(“Windows 11”); ieOptions.setBrowserVersion(“11.0”); HashMap<String, Object> ltOptions = new HashMap<String, Object>(); ltOptions.put(“username”, username); ltOptions.put(“accessKey”, accesskey); ltOptions.put(“project”, “TAS”); ltOptions.put(“w3c”, true); ieOptions.setCapability(“LT:Options”, ltOptions);

            ieOptions.attachToEdgeChrome();
            ieOptions.setCapability("ignoreProtectedModeSettings ", true);
            ieOptions.enablePersistentHovering();
            ieOptions.requireWindowFocus();
            capabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
            capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
            capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
            capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
            capabilities.setCapability(CapabilityType.SUPPORTS_ALERTS, true);
            capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
            capabilities.setCapability("lambdatest.ie.enablePopups", "true");
            ieOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
            ieOptions.merge(capabilities);

This is still BLOCKING Popups in Tests.

Please pass it in LTOptions