The experts who are using Selenium WebDriver from the beginning, they are aware of how IE Driver was evolved and what are all the desired capabilities were introduced. However, many don't know the IE driver settings and options which are required and why do we need them while instantiating WebDriver. As a leading software testing company, creating robust automated test scripts is one of the core values. Today, we will share important IE driver configurations which every automation tester should be familiar with.
Disable Native Events
InternetExplorerOptions options = new InternetExplorerOptions(); options.disableNativeEvents(); WebDriver driver = new InternetExplorerDriver(options);
Enable Persistent Hovering
IE driver window receives WM_MOUSEMOVE message to perform native mouseover event. However, we have a problem with this. The hover native event will be very quick and it won't persist. Hovering should happen as same as how an user does. If you enable Persistent Hovering, the WM_MOUSEMOVE message will be sent to the IE window multiple times to hover on a webelement in a separate thread.
InternetExplorerOptions options = new InternetExplorerOptions(); options.enablePersistentHovering();
Introduce Flakiness By Ignoring Security Domains
Never use this setting unless if your windows machine does not have the registry access to check the protected mode settings via WebDriver code. Whenever IE driver is instantiated, it will check Protected Mode settings in Windows Registry. If you want to ignore this checking, you can use this setting to ignore Protected Mode settings verification.
Note: Don't use "introduceFlakinessByIgnoringSecurityDomains" setting even though the protected mode settings are configured correctly and you have necessary access for the registry settings.
InternetExplorerOptions options = new InternetExplorerOptions(); options.introduceFlakinessByIgnoringSecurityDomains();
Ignore Zoom Settings
Whenever IE driver is launched, WebDriver will check whether the IE Zoom Level Setting is set to (100%). Setting 100% will ensure the automated testing execution robust and your Selenium WebDriver commands won't fail due to page formatting and WebElement sizing issues. If you want to ignore this detection while launching the IE driver, you can use "ignoreZoomSettings".
InternetExplorerOptions options = new InternetExplorerOptions(); options.ignoreZoomSettings();