Use Internet Explorer mode in Edge in Selenium tests
To test websites that rely on legacy Internet Explorer features, you can enable Internet Explorer mode in Microsoft Edge. This allows you to run Selenium tests on such sites without switching browsers.
Prerequisites
- Selenium 4 or later
- Perfecto cloud access
- Microsoft Edge browser on a Windows machine
Steps
-
In your Selenium script, specify Edge as the browser name.
-
Add the
ie-mode
capability to your script, either directly with theperfecto:
prefix or as a nested capability inside a HashMap, passed to theperfecto:options
capability, as shown in the following code snippet.CopyExample: Direct capabilitycapabilities.setCapability("browserName", "Edge");
capabilities.setCapability("perfecto:ie-mode", true);CopyExample: Nested capabilityHashMap<String, Object> options = new HashMap<>();
options.put("ie-mode", true);
capabilities.setCapability("perfecto:options", options);