Skip to main content

IE mode on Edge browser

Some (older) websites are built to run on Internet Explorer and might have features that are not supported by current browsers, such as Microsoft Edge. Microsoft Edge is the successor of Internet Explorer.

Microsoft Edge provides an Internet Explorer Mode with Microsoft Edge, which allows you to run the Edge browser just like you would be running an IE 11 browser.

IE mode on Microsoft Edge is supported from Selenium version 4 and higher.

Start using Internet Explorer Mode

To run your Selenium 4 tests with IE Mode and Edge, you can use the ie.edgechromium capability with se:ieOptions. Please see the example below.

options = Selenium::WebDriver::IE::Options.new
options.attach_to_edge_chrome = true
options.add_option('tb:options', {
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
})

driver = Selenium::WebDriver.for(:remote,
  url: 'https://hub.testingbot.com/wd/hub',
  options: options
)
InternetExplorerOptions options = new InternetExplorerOptions();
options.attachToEdgeChrome();

HashMap<String, Object> tbOptions = new HashMap<>();
tbOptions.put("key", "API_KEY");
tbOptions.put("secret", "API_SECRET");
options.setCapability("tb:options", tbOptions);

WebDriver driver = new RemoteWebDriver(new URL("https://hub.testingbot.com/wd/hub"), options);
$capabilities = DesiredCapabilities::internetExplorer();
$capabilities->setCapability('platformName', 'Windows 10');
$capabilities->setCapability('se:ieOptions', [
  'ie.edgechromium' => true
]);
$capabilities->setCapability('tb:options', [
  'key' => 'API_KEY',
  'secret' => 'API_SECRET'
]);

$driver = RemoteWebDriver::create(
  'https://hub.testingbot.com/wd/hub',
  $capabilities
);
from selenium.webdriver.ie.options import Options

options = Options()
options.attach_to_edge_chrome = True
options.set_capability('tb:options', {
  'key': 'API_KEY',
  'secret': 'API_SECRET'
})

driver = webdriver.Remote(
  command_executor='https://hub.testingbot.com/wd/hub',
  options=options
)
const { Builder } = require('selenium-webdriver');
const ie = require('selenium-webdriver/ie');

let options = new ie.Options();
options.setEdgeChromium(true);
options.set('tb:options', {
  'key': 'API_KEY',
  'secret': 'API_SECRET'
});

let driver = await new Builder()
  .usingServer('https://hub.testingbot.com/wd/hub')
  .setIeOptions(options)
  .build();
var options = new InternetExplorerOptions();
options.AttachToEdgeChrome = true;
options.PlatformName = "Windows 10";
options.AddAdditionalOption("tb:options", new Dictionary<string, object>
{
    ["key"] = "API_KEY",
    ["secret"] = "API_SECRET"
});

IWebDriver driver = new RemoteWebDriver(
    new Uri("https://hub.testingbot.com/wd/hub"),
    options
);
Was this page helpful?

Looking for More Help?

Have questions or need more information?
You can reach us via the following channels: