How to run Selenium script in IE Browser

How to run Selenium script in IE Browser

How to run Selenium script in IE Browser post gives you clear explanation to run or execute selenium webdriver test scripts in Internet Explorer i.e IE browser.To run  Selenium script in IE Browser you require InternetExplorerDriver which it is a standalone server.In order to run your Selenium script you have to download Internet Explorer Driver to run your selenium scripts,just go to Selenium site and search for Internet Explorer Driver Server here you will find 32 bit version and 64 bit version to download as per your machine/Laptop.

Please follow below steps to run Selenium script in IE Browser and create test scripts in selenium webdriver. Please unzip the IEdriver and you will find IEDriverServer.exe file from zip file as below.

ALSO READ  Selenium Data Driven Framework step by step

Trending Posts

How to handle UnhandledAlertException in selenium
Java Lang NullPointerException in Selenium
Send Extent Reports in Email with Screenshots
How to write Test Cases PASS or FAIL in Excel using Selenium
How to capture screenshot for failed test cases in Selenium

Just you need to write this extra code to open or run your selenium test scripts in IE Browser

System.setProperty("", "F:/Java_Apps/IEdriverServer.exe");
driver = new InternetExplorerDriver();

Please find below example to run Selenium script in IE Browser ,i have used my blog i.e to execute the test script with TestNG annotation,please read TestNG Tutorial.

package com.seleniumpractice.reports;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class InternetExplorer {

public WebDriver driver;
String baseUrl = "";

public void openBrowser() {
System.setProperty("", "F:/java_apps/IEdriverServer.exe");
driver = new InternetExplorerDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


public void openSite() {
//Verify whether exact page is open or not 
//Store page title in one String 
String actual_title = driver.getTitle();
System.out.println("Page title of website" + actual_title);
//If condition to verify page title 
String Expected_title = "Learn Selenium Automation Testing";

if (actual_title.equals(Expected_title)) {

System.out.println("Page title is matching with Expected Results - Test Case is PASS");
} else {
System.out.println("Page title is not matching with expected results - Test Case is Fail");
public void closeBrowser() {
//Close open browser 
System.out.println("IE Browser is closed");


ALSO READ  Page Object Model in Selenium WebDriver Step by Step Guide

Run the Test script as TestNG Test as Right click on Script – Run As – TestNG Test,you will see selenium test script execution in IE browser,most of the people facing speed issue in Internet explorer browser to open any website,in case selenium webdriver not finding page title in given time i.e 30 seconds,it will give you the error and it will fail the Test.

ALSO READ  Java Lang NullPointerException in Selenium

Test Results:

Once you execute the script it will display Test Results as below.

Started InternetExplorerDriver server (64-bit)
Listening on port 14471
Only local connections are allowed
Page title of websiteLearn Selenium Automation Testing
Page title is not matching with expected results - Test Case is Fail
PASSED: openSite

    Default test
    Tests run: 1, Failures: 0, Skips: 0

Default suite
Total tests run: 1, Failures: 0, Skips: 0
how to run selenium scripts in IE browser
Test Results

I hope you got good information about how to run Selenium script in IE Browser with the help of IEDriver Server i.e internet explorer driver server,please provide your valuable comments and suggestions on this post.

Rajesh K