Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Easy way to use Selenium Internet Explorer Driver

Author: Iamakhila Priya
by Iamakhila Priya
Posted: Oct 05, 2019

Mozilla Firefox, Google Chrome and Internet Explorer are the three main leading Browsers. That any QA Engineer might choose for Web automation Testing.

As of now, we use Internet Explorer Driver for Website test Automation. By that, we Design a Simple Selenium Regression testing Suite and operate a Small and Tiny test case for Demo.

If you have Read Our Old post by using Chrome for website test automation. Then it will be easy for you to Run this Post, IE is already in Selenium training browser, that guide an Executable Server.

It is the Implementation of Web driver, interface, that which Enable execution of Selenium Regression testing Suite.

Same like the chrome Driver, Internet Explore Driver module Talks. To the Web driver client using the WIRE protocol. But you Require Instructions for getting to work on it.

Firstly, let us see, how to download Internet Explorer driver. It comes in two flavors.

That is a 32 bit Version and 64-bit version. So Download the Version, that is by depending on the type of system, that you are using.

32 Bit Driver.

64 Bit Driver.

Use Internet Explorer Driver with Selenium

As we have specified above, you have to call a few activation steps. That is to use Internet Explorer Driver. So here the two cents, you spend is for Running test Code.

System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");

driver = new InternetExplorerDriver();

Since we already covered the design of Selenium online training testing projects in so many of our old posts.

In this post, I will keep you Focus only to design a Simple Selenium Regression testing.

Before We go further, I think it is a Good Idea for outlining use case. That we cover in the code snippet.

Validating the Title text of a page.

Navigating title text of the page.

Lunch Internet Explorer Browser.

Design an IE Web driver Example.

Activate Internet Explorer Driver Module.

You can see the sample Code here.

package com.selenium.regression;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.ie.InternetExplorerDriver;

import org.testng.Assert;

import org.testng.annotations.AfterClass;

import org.testng.annotations.BeforeClass;

import org.testng.annotations.Test;

public class IEBrowserTest {

public WebDriver driver;

@BeforeClass

public void setUp() {

System.out.println("*******************");

System.out.println("launching IE browser");

System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");

driver = new InternetExplorerDriver();

driver.manage().window().maximize();

}

@Test

public void testGooglePageTitleInIEBrowser() {

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

String strPageTitle = driver.getTitle();

System.out.println("Page title: - "+strPageTitle);

Assert.assertTrue(strPageTitle.equalsIgnoreCase("Google"), "Page title doesn't match");

}

@AfterClass

public void tearDown() {

if(driver!=null) {

System.out.println("Closing IE browser");

driver.quit();

}

}

}

As Every one of us know, that Internet Explorer works Only with Windows System. The Execution Speed is very Slow, when we compare it with other browsers.

When Working with Internet Explorer, We may end up It by Watching the issues. Like "No Such Element Found" Exception Due to Synchronisation.

Not to mention, when working with Internet Explorer Driver. We have some Issues with Mouse Events, The browser Window is not concentrating to over elements.

For avoiding test Scripts, they may work fine with Firefox and Chrome browsers. These are Intelligent and Enough to find elements in DOM.

Internet Explorer is very slow, because of which you will end this up with an Exception.

For avoiding this problem, while Executing scripts with Internet Explorer. You can try to make them use "CSS Selectors". This will minimize your problems.

Common Issues with Internet Explorer when we work with Selenium

If you See like this " Unexpected Error Launching Internet Explorer "

Below, you have to set "enable protected mode" Option in every level with the same value.

org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings is not same for every zone.

Start protect mode to set same value (enabled or disabled) for all zones. (WARNING: Server Don’t provide any stack trace information)

Command duration or timeout: 516 milliseconds

Follow the below Steps

Initiate Internet Explorer Browser, Choose Internet Options from Tools Menu

After that choose Security Tab

About the Author

Msbi represents Microsoft Business Intelligence. Msbi (Microsoft Business Intelligence) is one of the Etl apparatus identified with the database side.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Iamakhila Priya

Iamakhila Priya

Member since: Jul 15, 2019
Published articles: 13

Related Articles