Run Test on Internet Explorer Browser

Internet Explorer can be communicated with the help of Internet explorer driver. It serves as a link between your tests in Selenium and the Internet Explorer browser. IE driver server is an executable file that should be kept in any of the system path before starting tests.

Let’s start with Testcase by opening IE browser and navigate tohttps://demoapp1.tequality.tech/and close the browser

 

Step1: Right click on src folder and select New > Class

 

Step2: Provide Class Name and click on Finish

 

Step3: Open URL: https://selenium-release.storage.googleapis.com/index.html  in your browser and select any of the latest driver version according to your browser version. Download and unzip file.


Step4:
Set a system property “webdriver.ie.driver” to the path of your IEDriverServer.exe file and instantiate an IEDriver class.

Here below your test script will look like

 

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

public class IETest {

public static void main(String[] args) {


// System Property for IEDriver
System.setProperty("webdriver.ie.driver", "D:\IE Driver Server\IEDriverServer.exe");

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


//Maximize the browser
driver.manage().window().maximize();

// Launch Website and navigate to URL
driver.get("https://demoapp1.tequality.tech/");


//close the browser
driver.close();

}

}

 


Step5:
Run the code by right click on the Eclipse code and select Run As > Java Application