Improving IE Automation
Context
Nexial scripting is same for all the browsers but IE browser has its own unique constraints and limitation. In order to optimize the automation experience with IE, some additional settings are required prior to automation. Note that these tips are not necessarily required or guaranteed to resolve one’s challenges with IE. Both OS version and browser version play a part in the performance and reliability of the web automation running against IE.
Many of the tips show below are adapted from other websites and blogs such as
- http://toolsqa.com/selenium-webdriver/challenges-to-run-selenium-scripts-with-ie-browser/,
- https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver.
Before starting automation
- 100% zoom.
IE browser must be 100% zoom for reliable automation. Here’s how one can check/change such setting:
- Open IE browser. You can see a “cog wheel” menu icon at its top-right corner:
- Go to Tools option (
Alt+X
). You will get Zoom option with value in bracket.
- If the value is not 100%, click on Zoom and select 100% Zoom.
Alternative for above steps is open IE browser and simply press
Ctrl+0
. - Open IE browser. You can see a “cog wheel” menu icon at its top-right corner:
-
Maximize Window.
This seems to help to stabilize automation on IE. One can use web »maximizeWindow()
to maximize the window page. -
Click automation on IE should be rendered via JavaScript during automation.
For certain web applications, especially with heavy utilization of AJAX, timing between clicks can be tricky for IE using the conventional Seleniumclick()
method. This is a fairly well-known and oft-discussed issue. Many workarounds evolve around implicit and/or explicit waits, which either slow down the automation or increase compute requirement. Another way to get around the click issue is use JavaScript (instead of Selenium/WebDriver). In Nexial, one can enable click automation via JavaScript by settingnexial.browser.forceJSClick
totrue
. For more details, click here. -
Forcing the use of the 32-bit WebDriver for IE.
While both Windows (7 and up) and IE (10 and up) have been upgraded to 64-bit, there are still a few internal and background components that are still running as 32-bit processes. As such, until all the dependent processes are converted to 64-bit so that IE runs truly in the 64-bit space, it would be best to continue using the 32-bit version of the IE WebDriver for browser automation. The system variablenexial.forceIE32
is designed for specifically this purpose. By setting its value totrue
Nexial will continue to use the 32-bit IE WebDriver instead of the 64-bit one.
Note that this is a known issue for Windows 7 and IE 10. Future version of IE might rectify this issue such that one may be find using the 64-bit version of IE WebDriver to be satisfactory. If you are experiencing slowness during type-key automation, this is a telltale sign that the 32-bit version of the WebDriver is needed. -
Adjust implicit waits between command.
Depending on the application under test and the underlying IE and OS, it is at times necessary to adjust the maximum amount of wait time before proceeding to subsequent commands. The system variablenexial.pollWaitMs
is designated for such adjustment. It seems to be a common practice to adjust this system variable to a higher number for IE automation. Note that this will have direct performance implication. -
Browser Focus.
It seems that IE appears to not fully comply with the WebDriver-backed automation when it does not have the focus. This is especially apparent with regards to the click, mouse-down and mouse-up events. You can find further documentation around this topic from the Browser Focus section of the Internet Explorer Driver wiki page. In order to force browser focus, one can set thenexial.browser.ie.requireWindowFocus
system variable astrue
. - Preemptive Alert Check.
During automation, sometimes the AUT would generate a JavaScript alert dialog, perhaps unexpectedly. While such dialog component is active, no automation can proceed. In order to ease automation effort, Nexial has a feature to automatically check for the presence of a JavaScript alert dialog after a type- or click- command is executed. This can help reduce the effort to check for such dialog and possibly incur additional script development time. However, this checking routine in IE can be noticeably slow. For performance reason, one may choose to turn off such feature by settingnexial.web.preemptiveAlertCheck
asfalse
. Our tests show that turning off this feature could potentially improve overall automation performance by 12-20%.