Selenium with IE? Disable Native Events

The problem: super slow typing and broken clicking

IEDriverServer.exe
downloaded automatically by the Bonigarcia Driver Manager (via Selenide) to .m2\repository\webdriver\IEDriverServer\x64\3.141\Selenide 5.1.0

The solution: Disabling Native Events. Internet Explorer’s WebDriver tries using OS native events to drive the browser. And this does not work on 64bit machines. In order to run Selenium on IE you need to disable those native events and effectively make IE use JS to run the browser. Here’s how to achieve this in Java+Selenide:


Configuration.browser
= "ie";


if
(Configuration.browser.toLowerCase().equals("ie")) {
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer()
;
   
capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
   
Configuration.browserCapabilities = capabilities;
}


Selenide.open(
"google.com");

 

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s