Test IE mode in Microsoft Edge with Internet Explorer Driver


In collaboration with our friends in the Selenium project, the Microsoft Edge team is excited to announce that you can now test Internet Explorer mode in Microsoft Edge with Internet Explorer Driver. With just a few changes to an existing test that runs against Internet Explorer, you can get your tests running in Internet Explorer (IE) mode in Edge. By running your tests in IE mode, you will be able to verify that any legacy web content that runs in Internet Explorer will work as expected in IE mode in Microsoft Edge.

Validate IE mode for legacy websites and apps

IE mode is a feature in Microsoft Edge for organizations that still need Internet Explorer 11 for backward compatibility of business-critical legacy websites or apps. To learn more about IE mode, read What is Internet Explorer (IE) mode?.

Starting June 15, 2022, Internet Explorer 11 will no longer be supported on certain versions of Windows 10. For more information, read Internet Explorer 11 desktop app requirement FAQ. We recommend that organizations that still depend on IE11 transition to the Microsoft Edge browser, which supports rendering modern and legacy web content. You can learn more about deploying Microsoft Edge and setting up a Site List in our docs. To prepare for June 15, you can now use Internet Explorer Driver to validate that IE mode is the right solution for your business-critical legacy websites or apps.

What you’ll need to get started

To start running tests in IE mode in Edge, you need the following:

  1. Microsoft Edge
  2. Selenium 4 or later language bindings
  3. Internet Explorer Driver version or later

Once you download IE Driver, ensure that you set it up correctly with Selenium’s Required Configuration.

Code samples

The following C#, Python, Java, and JavaScript code samples assume you are using the Selenium framework but you can use any library, framework, or programming language that supports WebDriver. To accomplish the same tasks using another framework, consult the documentation for your framework of choice.

These code samples launch Microsoft Edge in IE mode, navigate to https://bing.com and runs a search for “IE mode”.


using System;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;

namespace IEDriverSample
    class Program
        static void Main(string[] args)
            var ieOptions = new InternetExplorerOptions();
            ieOptions.AttachToEdgeChrome = true;
            //change the path accordingly
            ieOptions.EdgeExecutablePath = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";

            var driver = new InternetExplorerDriver(ieOptions);
            driver.Url = "https://bing.com";
            driver.FindElement(By.Id("sb_form_q")).SendKeys("IE mode");



from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

ie_options = webdriver.IeOptions()
ie_options.attach_to_edge_chrome = True
ie_options.edge_executable_path = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"

driver = webdriver.Ie(options=ie_options)

elem = driver.find_element(By.ID, 'sb_form_q')
elem.send_keys('IE mode' + Keys.RETURN)



import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;

public class IEDriverSample {
    public static void main(String[] args) {        
        InternetExplorerOptions ieOptions = new InternetExplorerOptions();
        ieOptions.withEdgeExecutablePath("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe");
        WebDriver driver = new InternetExplorerDriver(ieOptions);

        WebElement elem = driver.findElement(By.id("sb_form_q"));
        elem.sendKeys("IE mode", Keys.RETURN);



const {Builder, By, Key, until} = require('selenium-webdriver');
const {Options} = require('selenium-webdriver/ie');

(async () => {
  let ieOptions = new Options();
  ieOptions.setEdgePath('C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe');

  let driver = await new Builder().
  try {
    await driver.get('http://www.bing.com');
    let elem = await driver.findElement(By.id('sb_form_q'));
    await elem.sendKeys('IE mode', Key.RETURN);
    await driver.wait(until.titleIs('IE mode - Bing'), 1000);
  } finally {
    await driver.quit();

For more information on automating IE mode in Edge, head to our docs.


If you run into any issues with the code samples, docs, or instructions in this blog post, you can follow up with the Microsoft Edge team on Twitter @EdgeDevTools or by submitting feedback in the Microsoft Edge browser (Alt+Shift+I).

If you are experiencing problems with IE Driver itself or are observing differences between IE Driver version and earlier versions, consult the Known limitations section of our docs. We have included workarounds for some of these known limitations. If you are still blocked, refer to the open issues in the Selenium repo and open a new issue if needed.

Finally, if you are noticing rendering differences between IE mode and the Internet Explorer 11 desktop app, refer to the IE mode troubleshooting and FAQ. If you still need help, you can contact the free App Assure program.

– Zoher Ghadyali, Senior Program Manager, Microsoft Edge


Source link

Related articles

Xbox Series X consoles are available for Best Buy’s Totaltech members

The Xbox Series X is sometimes a little easier to buy than Sony’s PlayStation 5, but that doesn’t mean it’s a simple endeavor. The good news is that Best Buy has...

Our Flag Means Death creator David Jenkins fancies a fine narrative fabric

For many people, Our Flag Means Death was an unexpected history lesson about the adventures of Stede Bonnet, the real 18th-century pirate who loved the high seas almost as much as...

How to change your default browser in Windows 11

If you’ve updated your PC from Windows 10 to Windows 11, you may have noticed that when you click on a link for a website, a PDF document, or a variety...

Fortnite’s Zero Build mode is bringing people back to the game

Fortnite’s latest season kicked off a big shakeup: developer Epic Games removed building, perhaps the game’s most iconic feature, from the core battle royale modes. It was a risky move that...

What Elon Musk’s Twitter ‘free speech’ promises miss

Thursday morning, Elon Musk offered to buy Twitter to save free speech. “I invested in Twitter as I believe in its potential to be the platform for free speech around the...

Latest articles