Internet Explorer

ie9-10The Internet Explorer Driver is easy to configure and use with Selenium WebDriver.

First of all, the driver must be downloaded from seleniumhq.org. I recommend the 32-bit version as it performs better and no worries, it works on a 64-bit OS.

 

Set it up using the following class:

public void setupIEDriver() {
 DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
 cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
 cap.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,false);
 cap.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false);
 cap.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR, true);
 cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
 cap.setJavascriptEnabled(true);
 System.setProperty("webdriver.ie.driver", "...\\IEDriverServer32.exe"); // driver location
 InternetExplorerDriver ieDriver = new InternetExplorerDriver(cap);
 ieDriver.manage().window().maximize();
}

Key takeaways:

  • The presented capabilities must be added to ensure the driver’s good performance.
  • The Internet Explorer driver does not support changing the user-agent. (e.g. to allow CAPTCHA bypass)

Add a Comment

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