Selenium hello world in IE Example

Download the Webdriver:
Webdriver Download

Add all the jars from the above downloaded to the build path.

Selenium Java Program to open Google:

import java.io.File;

import org.openqa.selenium.ie.InternetExplorerDriver;

public class SeleniumHelloWorld {
	public static void main(String[] args) {
		File file = new File("D:/IEDriverServer.exe");
		System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
		InternetExplorerDriver driver = new InternetExplorerDriver();
		driver.get("http://www.google.co.in");
	}
}

Output:
selenium output

Note:
Download the IE Driver:
32-bit IE Driver Setup Download
64-bit IE Driver Setup Download

By default selenium web driver will open in mozilla, if you want to open the same in IE then you have download the above IE driver and have to configure in the program as well.

859 total views, 1 views today

Leave a Reply

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