• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Basic Selenium / How to run Selenium Webdriver test in IE browser / Internet Explorer Driver

How to run Selenium Webdriver test in IE browser / Internet Explorer Driver

March 10, 2020 by Ritika Gulati 21 Comments

Launch IE Browser in Selenium

This post will guide you How to Launch IE Browser in Selenium Webdriver and recently Selenium started supporting the Microsoft Edge browser as well which is an added advantage for Windows 10 users.

In the previous post, we have already discussed for Chrome, Firefox, Edge Browser with third-party drivers. We will follow the same process for IE Browser as well.

You will also face few issues with IE Browser which I already listed in the below post so if you face any issue then do check out below link.

Challenges you will face while working with IE browser

 

 

 

How To Launch IE Browser in Selenium 

 

Step 1-Download IE driver for Selenium

Open-http://docs.seleniumhq.org/download/

Depends on your system requirement download the respective driver for Windows 32 download driver 32-bit driver same applies for 64 as well

Launch IE Browser in Selenium

A download window will open, wait till the download complete. Once you get zip file unzip the same you will get IEDriverServer.exe

Step 2- Write script for IE browser in Selenium

As we have seen in the last post for chrome, we talked about exception also same applies for IE also.

We need to set variable webdriver.ie.driver

Program for running IE Browser using Selenium

package demotc;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.ie.InternetExplorerDriver;

import org.testng.annotations.Test;

public class IEBrowser {

@Test

public void test12() throws Exception{

// Initialise browser

WebDriver driver=new InternetExplorerDriver();

// Load google.com

driver.get("http://www.google.com");

// close browser

driver.close();

}
}

 

Step 3- Run Program using Java application-

Right-click on program> run as >Java application

Output:

run selenium webdriver test in IE browser

Your program will fail because we haven’t set IE driver path so let’s set the path using setProperty method

package demotc;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.ie.InternetExplorerDriver;

import org.testng.annotations.Test;

public class IEBrowser {

@Test

public void test12() throws Exception{

// set driver path

System.setProperty("webdriver.ie.driver","driver path\\IEDriverServer.exe");

// Initialise browser

WebDriver driver=new InternetExplorerDriver();

// Load google.com

driver.get("http://www.google.com");

// close browser

driver.close();

}

}

 

Now your program will run successfully. 🙂

Some key points while working with IE Browser in Selenium.

  • IE browser is slow as compared to other browsers.
  • Your browser zooming level should be set to 100 % otherwise, you will get an exception.
  • You have to check your security setting also in IE. While running IE browser in Selenium your all zones should be either enabled or disabled. If not then again you will get an exception and your test cases will fail.

 

Filed Under: Basic Selenium Tagged With: IE Browser, Launch IE Browser in Selenium

Reader Interactions

Comments

  1. Sathish Kumar says

    August 1, 2019 at 5:29 PM

    Hi Mukesh,

    Few locators(xpath) are working fine in Chrome and Firefox but failing in IE browser during execution.. is there any way to implement it to be stable for all browsers or else its better to move for cssselector approach?

    Reply
    • Mukesh Otwani says

      August 2, 2019 at 10:22 AM

      Hi Sathish,

      In order to cop up with IE along with other browsers, i would recommend you to use CSSSelector

      Reply
      • Sathish Kumar says

        August 2, 2019 at 10:58 AM

        Thanks you so much Mukesh….

        Reply
  2. Bangarraju says

    May 3, 2019 at 4:42 PM

    Thank you so much Mukesh Otwani for providing a valid information

    Reply
    • Mukesh Otwani says

      May 3, 2019 at 5:12 PM

      Hi Bangarraju,

      You are always welcome…:)

      Reply
  3. Babu says

    January 31, 2017 at 5:05 PM

    Hi Mukesh,
    I have entered the code as mentioned below
    public static void main (String args[])
    {

    System.setProperty(“webdriver.ie.driver”,”C:\\SeleniumDrivers\\IEDriverServer.exe”);
    WebDriver driver = new InternetExplorerDriver();

    driver.get(“http://www.google.co.in”);
    }

    After executing, i am displayed with a new internet explorer browser with the message “This is the initial start page for the WebDriver server”. Waited for 10 mins, still it is not redirected the user to “google home page”.

    Please help me in the same

    Reply
    • Mukesh Otwani says

      January 31, 2017 at 6:15 PM

      Hi babu,

      Kindly check browser zoom settings along with Protected Mode settings. for details, please visit this link http://learn-automation.com/challenges-with-ie-browser-in-selenium-webdriver/

      Reply
  4. Su says

    January 24, 2017 at 7:41 AM

    All your articles very useful and knowledgeable.
    Doing really a great job.

    Reply
    • Mukesh Otwani says

      January 24, 2017 at 4:05 PM

      Thanks Mate

      Reply
  5. Su says

    January 24, 2017 at 7:37 AM

    Hi,
    Started with selenium recently, and found your website. It is really fabulous, and you really are doing a great job sharing your knowledge beautifully.

    Reply
    • Mukesh Otwani says

      January 24, 2017 at 4:47 PM

      Hi Su,

      Thanks for your comments…

      Reply
  6. Madhur says

    November 2, 2016 at 5:12 PM

    Hi,
    I am getting below error. Please help me.

    Started InternetExplorerDriver server (64-bit)
    2.53.1.0
    Listening on port 26458
    Only local connections are allowed
    Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 1.47 seconds

    Reply
    • Mukesh Otwani says

      November 4, 2016 at 1:52 AM

      Hi Madhur,

      Please follow below post

      http://learn-automation.com/challenges-with-ie-browser-in-selenium-webdriver/

      Reply
  7. Eknath Rao says

    October 20, 2016 at 5:05 PM

    is it not possible to set zooming level 100% and security settings in ie using selenium?

    Reply
    • Mukesh Otwani says

      October 20, 2016 at 5:39 PM

      Yes you can do that using below code

      DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
      caps.setCapability(“EnableNativeEvents”, false);
      caps.setCapability(“ignoreZoomSetting”, true);

      // Initialize InternetExplorerDriver Instance using new capability.
      WebDriver driver = new InternetExplorerDriver(caps);

      Reply
  8. Ajay says

    September 21, 2016 at 7:10 AM

    Hi Mukesh,

    I was successfully able to run IE browser and navigate to a page. But my browser is not getting closed even after using driver.close() method. However it was working fine in chrome. please let me know the reason.

    Reply
    • Mukesh Otwani says

      September 23, 2016 at 11:31 PM

      Hi Ajay,

      quit will work in this case.

      Reply
  9. Shobha says

    September 3, 2016 at 11:09 AM

    Hi mukesh,

    please go through the below code when i run this i am getting the title as Webdriver in the console if i run same code using other browsers i am getting the correct output.please let me know what is wrong with the code
    {

    System.setProperty(“webdriver.ie.driver”, “F:\\selenium drivers\\IEDriverServer.exe”);

    WebDriver driver=new InternetExplorerDriver();

    driver.get(“http://www.learn-automation.com”);

    System.out.println(“Title is ” +driver.getTitle());

    }

    }

    Reply
    • Mukesh Otwani says

      September 8, 2016 at 12:03 AM

      Hi Shobha,

      Make below changes in IE and then run the same code again http://learn-automation.usefedora.com/courses/selenium-frameworks-and-selenium-question-answers

      Reply
  10. sathishkumar says

    July 2, 2016 at 1:22 PM

    I m having below code, but facing the below issue. I have latest ie driver files, latest selenium external jar files. Please help me to understand.

    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.ie.InternetExplorerDriver;

    public class ie
    {
    public static void main(String args[])
    {
    System.setProperty(“Webdriver.ie.driver”, “D:\\IEDriverServer.exe”);
    WebDriver driver = new InternetExplorerDriver();
    driver.manage().window().maximize();
    driver.get(“https://paytm.com/”);

    }
    }

    Issue faced:
    Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.ie.InternetExplorerDriverService.access$0(InternetExplorerDriverService.java:1)
    at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:146)
    at paytm.ie.main(ie.java:12)

    Reply
    • Mukesh Otwani says

      July 2, 2016 at 3:03 PM

      Hi,

      PLease make below change

      Old code

      System.setProperty(“Webdriver.ie.driver”, “D:\\IEDriverServer.exe”);

      New code

      System.setProperty(“webdriver.ie.driver”, “D:\\IEDriverServer.exe”);

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Best and easy way to Group test cases in selenium

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?