Selenium WebDriver typing very slow in text field on IE browser

Internet ExplorerSeleniumSelenium Webdriver

Internet Explorer Problem Overview


I'm running one of my scripts on IE 11 browser with Selenium 2.43.1 when the script types in text field using following:

element.sendKeys("string");

In IE browser, I can see that one character of string is typed in text field and it waits for 1-2 seconds before typing next character. Means for typing one character it's taking 1-2 seconds.

  1. Why is typing so slow with IE?
  2. Is there any alternate way to speed up typing?

Internet Explorer Solutions


Solution 1 - Internet Explorer

My issue was with the driver architecture, and fixed it by downloading and using a 32bit one.

To switch to 32 bit here is what you have to do

  1. Download 32 bit driver service from http://selenium-release.storage.googleapis.com/index.html

  2. Instantiate your InterExplorerWeDriver class using InternetExplorerDriverService class with path to 32 bit driver service.

    InternetExplorerDriver ieDiver = new InternetExplorerDriver(“Path to the 32 bit Explorer driver”);

OR if using a builder:

System.setProperty(“webdriver.ie.driver”,“C:\\drivers\\IEDriverServer.exe”);
DesiredCapabilities ieCapabilities=DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver
 .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
ieCapabilities.setCapability("requireWindowFocus", true);
File ie_temp=newFile(“C:\\Selenium\\IEDrivertemp”);
InternetExplorerDriverService.Builder 
ies=newInternetExplorerDriverService.Builder();
ies.withExtractPath(ie_temp);
InternetExplorerDriverService service=ies.build();
WebDriver driver=newInternetExplorerDriver(service,ieCapabilities))

The thread that helped me resolve

http://forumsqa.com/question/typing-too-slow-in-text-fields-while-replaying-tests/

Solution 2 - Internet Explorer

For me it worked with 64bit version of IEDriverServer. I added the property requireWindowFocus with "true" value:

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
...
capabilities.setCapability("requireWindowFocus", true);
WebDriver driver = new InternetExplorerDriver(capabilities);

I'm using version 2.47 of Selenium/IE Driver

Solution 3 - Internet Explorer

For 64 bit WebDriver:

  1. Open IE
  2. Go to Internet Options → Advanced → Security
  3. Check ☑ Enable 64-bit processes for Enhanced Protected Mode
  4. Click Apply and OK

For 32 bit WebDriver:

  1. Open IE
  2. Go to Internet Options → Advanced → Security
  3. Uncheck ☐ Enable 64-bit processes for Enhanced Protected Mode
  4. Click Apply and OK

strangely:

  • The setting was necessary no matter if enhanced protected mode was activated or not.
  • Other than the text says in the dialog, restarting my computer was not necessary.

My setup: Windows 10, IE 11, everything 64 bit, Selenium 3.4

Solution 4 - Internet Explorer

This sped it up for me a little bit. IEDriverServer 2.53.1

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.RequireWindowFocus = true;
driver = new InternetExplorerDriver(options);

Solution 5 - Internet Explorer

You can change to the 32-bit version, but if 64-bit is required then you can try this solution:

  • Internet Options -> Security -> Check "Enable Protected Mode" for all zones
  • Go to Advanced -> Security -> Check "Enable Enhanced Protected Mode"

This results in no more snail typing on 64-bit IE.

Solution 6 - Internet Explorer

For tests running on IE11 64bit, setting the NATIVE_EVENTS capability to false worked for me. Without it, using the 64bit driver server 3.0 was extremely slow as reported. The 32bit 3.0 driver server swallowed some of the chars it was supposed to send (e.g. "FluentLenium" became "FlntLnum").

The following resolved both problems.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
WebDriver driver = new InternetExplorerDriver(capabilities);

I am not sure whether this has additional side effects.

Solution 7 - Internet Explorer

I had the same problem when using the 64bit version of IEDriverServer. Change to the 32bit and It worked fine.

Source: https://stackoverflow.com/questions/14461827/webdriver-and-ie10-very-slow-input

Solution 8 - Internet Explorer

I also had the same issue way back. You can try out by

>Internet Options -> Connections -> LAN Settings -> Untick Automatically detect settings.

Hope this helps.

Solution 9 - Internet Explorer

I also faced the same issue with IE11 on Windows x64 bit. I was using 64bit version of IEDriverServer.exe (IE driver-3.7.0 with selenium-3.7.0).

After I changed to 32bit version of IEDriverServer.exe, it solved the issue

Solution 10 - Internet Explorer

For IEServerDriver 3.14.0 this works for speeding up typing a bit.

WebDriver browser;
InternetExplorerOptions options = new InternetExplorerOptions();
    options.disableNativeEvents();
    options.requireWindowFocus();
browser = new InternetExplorerDriver(options);

DesiredCapabilities method is deprecated and options.IntroduceInstabilityByIgnoringProtectedModeSettings = true; and options.RequireWindowFocus = true; are no longer available.

Solution 11 - Internet Explorer

This probably is an issue with the machine you are running the test on. If you experience general lag with the computer, then this will happen.

> Is there an alternate way to speed up typing?

Sure, you can create a custom method to clear the text, then use JavaScript to fill the field. (mind you that doing this, might not be able to work with things like "typeahead" and "suggestions as you type")

Solution 12 - Internet Explorer

I struggled almost a day for finding out. This is because the 64 bit IE Driver sever (IEDriverServer_x64_2.53.1).

I switched to IEDriverServer_Win32_2.53.1 then it worked, it is superfast now!

Solution 13 - Internet Explorer

Disable NATIVE_EVENT resolved my issue

 DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
 capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
 driver = new InternetExplorerDriver(capabilities);

Solution 14 - Internet Explorer

You can change to 32 bit version,it will be speed compare to 64 bit.

Solution 15 - Internet Explorer

Instead of WebEelement.send.keys, I used Actions object with sendKeys method. This worked like a charm.

Solution 16 - Internet Explorer

to improve the speed for send Keys function, one can perform below steps:-

  1. go to project-->properties->Java compiler-->under the java compliance --deselect the use compliance option and change the compile compliance level to 1.7 and then click to apply.

It will work smoothly.

Solution 17 - Internet Explorer

Just some remarks that will not solve the issues from the original question, but may help someone with similar problem today:

For other browsers, their driver version usually depends on browser version, but for IE driver, version depends on the selenium version!

I want to stress this, because it is important and I did not find it pointed out anywhere in the answers. I also didn't know about this until recently. Today (when creating this post), selenium package from public python repository is on version 3.141.0, but selenium.dev page recommends to download 32-bit IE driver version 3.150.1; these two versions are not fully compatible and so I was experiencing the same issue (however, from different reason).

Unfortunately, pieces of advice from this thread, namely setting RequireWindowFocus to True, solved the slow typing issue for me. I say unfortunately, because my tests stayed unstable, and, as a bonus, browser window was still in the front of everything and was physically moving the mouse cursor on clicks, making it impossible for me to execute multiple tests in parallel.

My issue was definitely solved after replacing driver of the newest stable version with the older one matching my selenium package version, and I don't even need to mess with RequireWindowFocus (and all other options I do not want) anymore.

Keep testing!

Solution 18 - Internet Explorer

The below code helped me with resolving the issue.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
...
capabilities.setCapability("requireWindowFocus", true);
WebDriver driver = new InternetExplorerDriver(capabilities);

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlphaView Question on Stackoverflow
Solution 1 - Internet ExplorerMaster SlaveView Answer on Stackoverflow
Solution 2 - Internet ExplorerPepsiGooseView Answer on Stackoverflow
Solution 3 - Internet ExplorerMarcusView Answer on Stackoverflow
Solution 4 - Internet ExplorerDemodaveView Answer on Stackoverflow
Solution 5 - Internet ExplorerViet PhamView Answer on Stackoverflow
Solution 6 - Internet ExplorerwwernerView Answer on Stackoverflow
Solution 7 - Internet ExplorerJamie ReesView Answer on Stackoverflow
Solution 8 - Internet ExplorerVivek SinghView Answer on Stackoverflow
Solution 9 - Internet ExplorerSrikanth GurramView Answer on Stackoverflow
Solution 10 - Internet ExplorerJimmy GarpehällView Answer on Stackoverflow
Solution 11 - Internet ExplorerddavisonView Answer on Stackoverflow
Solution 12 - Internet ExplorerS KotraView Answer on Stackoverflow
Solution 13 - Internet ExplorerNaren ChejaraView Answer on Stackoverflow
Solution 14 - Internet ExplorerSivananda ReddyView Answer on Stackoverflow
Solution 15 - Internet ExplorerNisim NaimView Answer on Stackoverflow
Solution 16 - Internet ExplorerRuchi DahiyaView Answer on Stackoverflow
Solution 17 - Internet ExplorerMichalView Answer on Stackoverflow
Solution 18 - Internet ExplorerChandraView Answer on Stackoverflow