• Selenium Video Tutorials

Selenium - IE Driver



The Internet Explorer is an independent server which implements the Webdriver’s wire protocol. This has been verified with the internet explorer 11 version and in Windows 10. It might work with the previous versions of internet explorer and Windows, however it is not officially supported.

The driver provides support to the 32 and 64 bits browser versions. For example, if the 32 version of the IEDriverServer.exe is used, then the internet explorer with the 32 bit version shall be opened. Similarly, if the 64 version of the IEDriverServer.exe is used, then the internet explorer with the 64 bit version shall be opened.

IE Driver Installation

There is no prerequisite to execute any installer prior using the InternetExplorerDriver, however some configurations may be needed. The standalone server executable is available from the below link in the highlighted section of the image https://www.selenium.dev/downloads/.

Selenium IE Driver

Once it has been downloaded, it should be set in the correct path.

Advantages of IE Driver

InternetExplorerDriver executes in real browsers and works with JavaScript.

Disadvantages of IE Driver

InternetExplorerDriver is only applicable to Windows and is on a slower side.

What are Command Line Switches?

The characteristics of InternetExplorerDriver can be updated by taking help of multiple command-line arguments.

Switch Purpose
–port=<portNumber> Points to the port on which the HTTP server of the InternetExplorerDriver communicates with the commands from the language bindings. Default value is 5555.
–host=<hostAdapterIPAddress> Points to the IPAddress of the host adapter on which the HTTP server of the InternetExplorerDriver communicates with the commands from the language bindings. Default value is 127.0.0.1.
–log-level=<logLevel> Points to the level at which the logging messages are generated. Correct values are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. Default value is FATAL.
–log-file=<logFile> Points to the complete path and file name of the log file. Default value is stdout.
–extract-path=<path> Points to the complete path of the directory for extracting the support files utilized by the server. Default value is TEMP, if not mentioned.
–silent Suppresses the diagnostic output when the server is put on.

What are Vital System Properties?

The system properties are configured using the System.setProperty() in Java or by using -DpropertyName=value command line flag utilized by the InternetExplorerDriver.

Switch Purpose
webdriver.ie.driver Points to the location of the IE driver binary.
webdriver.ie.driver.host Points to the IPAddress of the host adapter on which the the InternetExplorerDriver communicates with the commands from the language bindings.
webdriver.ie.driver.loglevel Points to the level at which the logging messages are generated. Correct values are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. Default value is FATAL.
webdriver.ie.driver.logfile Points to the complete path and file name of the log file.
webdriver.ie.driver.silent Suppresses the diagnostic output when the server is put on.
webdriver.ie.driver.extractpath Points to the complete path of the directory for extracting the support files utilized by the server. Default value is TEMP, if not mentioned.

Prerequisites for IE Driver Configurations

  • The IEDriverServer should be downloaded from the link https://www.selenium.dev/downloads/
  • Once it has been downloaded, it should be set in the correct path.
  • On internet explorer version 7, higher versions of Windows Vista, Windows 7, and Windows 10, the Protected mode should be set the same for all zones. The value can be turned on and off provided it bears the same value for every zone.

    To set the Protected Mode, select Internet Options from the Tools menu and navigate to the Security Tab. For every zone, there is a checkbox at the end of the tab called the Enable Protected Mode.

  • The Enhanced Protected Mode available in the Advanced tab of the Internet Options dialog, should be disabled for internet explorer version 10 and above.
  • The zoom of the browser should be set to 100% which helps the native mouse events to the proper coordinates.
  • The parameter Change the size of text, apps, and other items should be set to 100% for internet explorer version 10.
  • We should set the registry entry on the target computer so that the driver can have a connection to the internet explorer object. For 32 bit windows, the key value should be −
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
   \Main\FeatureControl\FEATURE_BFCACHE

For 64 bit windows, the key value should be −

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft
   \Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

It should be noted that the subkey FEATURE_BFCACHE, should be created if not available. Also within this key, generate a DWORD value called the iexplore.exe set to 0.

What are Native Events and Internet Explorer?

Since the InternetExplorerDriver runs on Windows only, it tries to utilize the so-called native or OS level events to do mouse and keyboard actions on the browsers. This is in contrast to utilizing the simulated JavaScript events for the same operations.

The pros of using the JavaScript Events is that it does not require the JavaScript sandbox and it confirms correct JavaScript event propagation inside the browser. But presently there are few problems with mouse events when the IE browser does not have focus and while trying to hover on elements.

Browser Focus

The issue is that the IE browser does not fully support the Windows messages that are sent to the browser window when it does not have focus. The only element being clicked should have a focus window but the click will not be undergone by the element.

Hovering Over Elements

While trying to hover over elements, the physical mouse is at the boundary of the IE browser window, but the hover does not work. It appears to work for a very small time but then again the element moves back to its previous state.

Clicking <option> Elements or Submit Forms and alert()

Sometimes the IEDriver does not communicate with elements using the native events, for example while selecting the <option> elements within the <select> tag. Besides, the same issue is faced while using the submit(), alert(), prompt() methods.

Multiple Instances of InternetExplorerDriver

The IEDriverServer.exe allows creation of more than one object of the InternetExplorerDriver. But this feature is not yet thoroughly tested and may have issues on focus, cookies etc. So it is recommended to use the virtual machines and RemoteWebDriver instead. There are two solutions related to cookies shared among the more than one objects of the internet explorer. The first step is to launch the internet explorer in private mode.

Post that the internet explorer will be opened with clean session data and will not store the modified session data at termination. To achieve that, pass the capabilities - orceCreateProcessApi with the value true and browserCommandLineSwitches with the value -private. This is only applicable to internet explorer version 8 and above and windows registry having the below value and its path should have the key TabProcGrowth set to 0 −

HKLM_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main.

To clean the session at the InternetExplorer initiation, we need to pass the capability ensureCleanSession with the true value. It will help to clear the cache for all the executing instances of the internet explorer.

Execute IEDriverServer.exe Remotely

To execute the internet explorer driver inside a remote machine, we need to use the standalone remote server in connection with the language binding similar to the RemoteWebDriver.

Execute IEDriverServer.exe Under Windows Service

Executing the internet explorer driver within the Windows Service application is not supported. It is also not tested yet in this regard. It may be possible to run the internet explorer driver within the Windows Service application, but there may be many problems which need to be resolved.

Conclusion

This concludes our comprehensive take on the tutorial on Selenium IE Driver. We’ve started with describing IE Driver Installation, advantages and disadvantages of IE Driver, what are the Command Line Switches, what are Vital System Properties, prerequisites for IE Driver Configurations, what are Native Events and Internet Explorer, multiple instances of InternetExplorerDriver, execute IEDriverServer.exe Remotely, and execute IEDriverServer.exe Under Windows Service.

This equips you with in-depth knowledge of the Selenium IE Driver. It is wise to keep practicing what you’ve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons.

Advertisements