Selenium Internet Explorer Driver

import java.io.File;
import org.openqa.selenium.By;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

public class IEDriver {

	public static void main(String[] args) {
		File file = new File("C:/Users/saikatd/Downloads/IEDriverServer_x64_2.39.0/IEDriverServer.exe");
        System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
		DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
		ieCapabilities.setCapability("ignoreZoomSetting", true);
        ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
		InternetExplorerDriver driver = new InternetExplorerDriver(ieCapabilities);
		try {
			// TODO Auto-generated method stub
			driver.navigate().to("https://saikatd.wordpress.com");
			Thread.sleep(1000);
			driver.findElement(By.id("s")).sendKeys("selenium");
			Thread.sleep(1000);
			driver.findElement(By.id("searchsubmit")).click();
			Thread.sleep(1000);
			driver.quit();
		}
		catch (Exception e) {
			System.out.println(e.toString());
			driver.quit();
		}
	}
}
Advertisements
This entry was posted in Information Technology. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s