How To Run Test Cases Using Internet Explorer In Selenium Automation Script

It is very easy to run test cases using Internet Explorer in selenium webdriver. You can not launch Internet Explorer directly in java but you can use selenium IE Driver server to communicate with it instead. So what selenium IE Driver server is and how to use it?

What is selenium IE Driver server?

Although there is not any native Internet Explorer implementation in selenium webdriver, but selenium webdriver commands should be directed to Internet Explorer by IEDriver server. It is just a bridge between your selenium commands and browser. It is implemented in a windows executable file. You should download it first and then add it to your system path before using it.

Goto following page to download the latest version.

I just download because my OS is windows 64 bit OS.

After download, extract it to a local directory. I extract it to C:\Workspace\\Lib\IEDriverServer_x64_3.4.0

Launch Internet Explorer using selenium webdriver

Method 1: Set system property “”‘s value to IE Driver executable file path.

It is very easy to create and use Internet Explorer in selenium webdriver. You just need to specify the IE Driver executable file path in system property “” and then use InternetExplorerDriver to initiate and manage Internet Explorer like following.

 String ieDriverFilePath = "C:\\Workspace\\\\Lib\\IEDriverServer_x64_3.4.0\\IEDriverServer.exe";
 //Specify the executable file path to sysem property.
 System.setProperty("", ieDriverFilePath);
 //Initiate web browser
 InternetExplorerDriver ieDriver = new InternetExplorerDriver();

You should make your Internet Explorer’s “Protected Mode Settings” same value to all zones before running the code above. Otherwise you may encounter exceptions.

Change “Protected Mode settings” to same value in IE

  1. Open your Internet Explorer Click tools —> Internet Options
  2. Click Security tab, check Enable Protected Mode checkbox for all zones.
    enable protected mode for all zones in internet options
  3. Click OK.

Method 2: Use IE Driver service builder

Another way to run Internet Explorer in selenium webdriver is to use IE Driver service builder. You can specify IEDriver executable file path to the service builder instead of system property. You can set log file also, with log file you can debug any issue easily.

 String ieDriverFilePath = "C:\\Workspace\\\\Lib\\IEDriverServer_x64_3.4.0\\IEDriverServer.exe";
 //Create server service builder
 InternetExplorerDriverService.Builder ieDriverServiceBuilder = new InternetExplorerDriverService.Builder();
 //Start sever on any free and available port.
 //Specify IEDriver executable file.
 ieDriverServiceBuilder.usingDriverExecutable(new File(ieDriverFilePath));
 //Specifies log level
 //Specify where log file stored.
 ieDriverServiceBuilder.withLogFile(new File("C:\\Workspace\\\\logFile.txt"));
 //Initiate a service
 InternetExplorerDriverService service =;
 //Use service object to initiate IEDriver instance
 InternetExplorerDriver ieDriver = new InternetExplorerDriver(service);

More about selenium IE Driver Server

Now you have known how to start and communicate with IEDriver server in selenium webdriver. But you can also start it as a standalone, waiting for commands coming from your webdriver actions and pass those commands to Internet Explorer. Webdriver actions include Webdriver.findElement, Webdriver.get etc.

You can start IEDriver server simply by type “IEDriverServer.exe” in your extracted directory in dos window as following.
start ie driver server standalone

If you add -help to IEDriverServer.exe, it will list all parameters and description that can by applied to it.
help for IEDriver server

How to start IE Driver server with different port number

If you want to start it with a port other than default port number you can input command with port parameter as following.
IEDriverServer.exe /port=8088

You can also specify log file path and log level with parameter.
IEDriverServer.exe /log-file=C:\\Workspace\\\\ieDriverLog.txt /port=8088 /log-level=DEBUG
ie driver server with more parameters

How to connect to existing IE Driver server

Now the standalone IE Driver server is running. You can connect to it in your java code simply by specify the server ip and port number.

 //Set IEDriverServer port number.
//Specify executable file path.
 ieDriverServiceBuilder.usingDriverExecutable(new File(ieDriverFilePath));
//Set IEDriver server host ip.

[download id=”301″]

0 0 vote
Article Rating
Notify of

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

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x