How to run Selenium tests on IE using IE Driver?

Follow this guide to configure IE Driver and execute Selenium tests seamlessly on Internet Explorer for legacy app support.

Get Started free
Guide Banner Image
Home Guide How to run Selenium tests on IE using IE Driver?

How to run Selenium tests on IE using IE Driver?

Chrome dominates global browser usage, but Internet Explorer (IE) remains in use, especially within enterprises and legacy systems. Historical data shows IE once held around 7% of desktop usage, largely due to familiarity and compatibility with older applications.

Despite its decline, IE’s presence in certain environments makes it essential for QA teams to test and ensure application compatibility where it’s still required.

Overview

How to run Selenium tests on Internet Explorer (IE) using the IE Driver?

  • Download and Install IE Driver: Obtain the InternetExplorerDriver from the official Selenium website, ensuring it matches your system’s architecture (32-bit or 64-bit).BrowserStack
  • Set System Property: Configure the system property in your Selenium script to specify the path to the IE Driver executable
  • Write and Execute Test Scripts: Develop your Selenium test scripts using standard WebDriver commands to interact with web elements in IE.
  • Utilize BrowserStack for Testing: Leverage BrowserStack’s cloud platform to run your Selenium tests on real IE browsers without the need for local setup, ensuring compatibility across different versions and configurations.

This article explains how QA professionals can automate testing for web applications on the Internet Explorer browser using the Selenium IE Driver.

What is Selenium IE Driver?

The Selenium IE Driver (also known as Selenium Internet Explorer Driver) is a stand-alone server that implements the WebDriver protocol. This server acts as a link between Selenium scripts and Internet Explorer.

Note: It is important for QAs to download the IE driver compatible with their working environment (32 bit or 64 bit).

Transformation from Internet Explorer to Microsoft Edge

Microsoft officially began phasing out Internet Explorer in favor of Microsoft Edge, its modern, Chromium-based browser, to provide better speed, security, and web compatibility.

Support for IE 11 ended for most Windows versions in June 2022, with Microsoft encouraging users to switch to Edge.

To ease the transition for enterprises relying on legacy web apps, Edge includes an “IE Mode”, which allows users to run older sites that require Internet Explorer within the Edge browser itself. This approach ensures continued compatibility while gradually moving users toward a more modern and secure browsing environment.

IE Driver System Requirements and Compatibility

Before using the Selenium IE Driver, it’s important to ensure your system meets the required configurations, as Internet Explorer automation has several unique limitations and prerequisites:

System Requirements:

  • Operating System: Windows 7, 8, 8.1, 10, or 11 (only on systems where IE is still supported).
  • Browser Version: Internet Explorer 11 (required; earlier versions are no longer supported).
  • Java: JDK 8 or above (for Java-based Selenium projects).
  • Selenium Version: Use a compatible version that still supports the IE Driver (e.g., Selenium 3.x or early Selenium 4.x versions).
  • IE Driver Server: Must match the architecture (32-bit or 64-bit) of the Internet Explorer browser installed.

Talk to an Expert

Steps to Configure the IE Driver

  1. Download the zip file of the InternetExplorerDriver from the official site. Make sure the downloaded version is compatible with the working environment.
  2. Unzip the file and copy it to a specific location.
  3. Download and install the IDE of your choice. Also, import all the Selenium dependencies.
  4. Define the IE Driver along with its path using the setProperty method and instantiate the IE Driver class.
    Refer to the sample code snippet below:
// Defining System Property for the IEDriver 
System.setProperty("webdriver.ie.driver", "D:IE Driver ServerIEDriverServer.exe"); 

// Instantiate a IEDriver class. 
WebDriver driver=new InternetExplorerDriver();

How to launch the IE Driver in Selenium?

At this point, you have completed configuring your IE Driver. Now let’s take a simple scenario that will explain how to launch the IE browser in Selenium and navigate to a specific website. In this scenario, we will automate three simple steps:

  1. Open the Internet Explorer browser
  2. Navigate to the Google website (www.google.com)
  3. Enter BrowserStack in the search box.

Note: For automating specific test scenarios, one needs to interact with several web-elements like text boxes, buttons, etc. To do so, one must know how to locate these elements. To understand how to locate elements in Selenium Webdriver, refer to this guide on Locators in Selenium.

Now let’s code the above scenario.

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.ie.InternetExplorerDriver;


public class IEexample {
public static void main(String[] args) {

//Setting system properties of InternetExplorerDriver
System.setProperty("webdriver.ie.driver", "D:IE Driver ServerIEDriverServer.exe"); 

//Creating an object of InternetExplorerDriver
WebDriver driver=new InternetExplorerDriver();
driver.manage().window().maximize();

//Deleting all the cookies
driver.manage().deleteAllCookies();

//Specifiying pageLoadTimeout and Implicit wait
driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

//launching the specified URL
driver.get("https://www.google.com/");

//Locating the elements using name locator for the text box
driver.findElement(By.name("q")).sendKeys("BrowserStack");

//name locator for google search button
WebElement searchIcon = driver.findElement(By.name("btnK"));
searchIcon.click();
}
}

When the above script is executed, the InternetExplorerDriver launches the IE browser, navigates to the Google website, and enters “BrowserStack” as the search query in the search box.

Although the market share of Internet Explorer might make it seem like one can avoid testing web-apps on IE, that’s not the case. As a business owner, one must leave no stone unturned to cater to potential customers. Optimizing web-applications for IE ensures that businesses are going the extra mile to provide a truly inclusive experience. This helps organizations establish their credibility and increase revenue flow.

BrowserStack offers robust support for testing websites on Internet Explorer through both Live and Automate platforms.

BrowserStack Live Banner

With BrowserStack Live, QA teams can manually test websites on real Windows machines running various versions of IE, enabling real-time interaction, inspection, and debugging without the need for local setup.

For automated testing, BrowserStack Automate allows users to run Selenium test suites on real IE browsers hosted in the cloud. This eliminates the complexity of configuring the IE Driver locally and supports parallel test execution. It also provides detailed logs, screenshots, and video recordings for efficient debugging.

Conclusion

Running Selenium tests on Internet Explorer using the IE Driver is essential for ensuring compatibility with legacy systems, especially in enterprise environments. Despite IE’s declining usage, some organizations continue to rely on it due to internal dependencies and long-standing infrastructure.

By properly configuring the IE Driver, handling its known limitations, and following best practices, QA teams can effectively automate their tests on IE.

For a more streamlined experience, platforms like BrowserStack offer real device and browser support for Internet Explorer, removing the need for complex local setups and ensuring accurate test results across real user conditions.

Try BrowserStack Now

Tags
Automation Testing Cross browser testing Selenium Selenium Webdriver

Get answers on our Discord Community

Join our Discord community to connect with others! Get your questions answered and stay informed.

Join Discord Community
Discord