59

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?
Alpha
  • 13,320
  • 27
  • 96
  • 163
  • possible duplicate of [Why is Selenium InternetExplorerDriver Webdriver very slow in debug mode (visual studio 2010 and IE9)](http://stackoverflow.com/questions/8850211/why-is-selenium-internetexplorerdriver-webdriver-very-slow-in-debug-mode-visual) – Manu Jul 07 '15 at 12:34
  • 1
    possible duplicate of [WebDriver and IE10 very slow input](http://stackoverflow.com/questions/14461827/webdriver-and-ie10-very-slow-input) – Louis Sep 21 '15 at 10:29
  • same for Selenium 3.4 – Marcus May 09 '17 at 07:53

18 Answers18

59

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/

Master Slave
  • 27,771
  • 4
  • 57
  • 55
  • true, edited and explained the gist, but as there are other answer pointing to the same cause, and since I got a downvote, will most likely delete the answer :) – Master Slave Jan 16 '15 at 15:16
  • 1
    To check if you have a 32- or 64bit IE running: See https://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/version-of-ie-32-bit-or-64-bit-how-can-i-tell/75488de3-fffa-4782-be0a-c536c9a70151 – Peti Jun 27 '17 at 13:53
  • 4
    I am on a 64bit Windows machine, so I thought "why should I use the 32bit WebDriver?" But then I checked; lo and behold, my 64bit machine came with 32bit Internet Explorer. This answer -even though I disregarded it initially- was the only thing that worked. You can download the IEDriverServer.exe on http://www.seleniumhq.org/download/ – neXus Oct 12 '17 at 09:55
  • The 64 bit WebDriver is just as fast if you check that IE setting “Enable 64-bit processes for Enhanced Protected Mode” (see my answer below). – Marcus Nov 12 '18 at 10:57
  • It would have been great if you had copy-pasted from that reference link instead of referring us to it. That site's gone down, unfortunately. – Mugen Jan 31 '19 at 06:39
  • @neXus Thank you, I am using 32 bit mode and it is faster, PLUS the webpages aren't hanging like they did before. Note this fixes for Python language as well. Marcus The problem with that is the tutorial I was following explicitly said to "Uncheck Enhanced Protected Mode" even for both 32 and 64bit. So, my tutorial was wrong. But anyway, just use 32 bit - it's straightforward. :) – Corey Levinson Jan 31 '20 at 20:23
  • Yep. This worked for me, even though I _am_ running 64 bit IE, I was still better off using the 32-bit driver. Sheesh. – recantha May 19 '20 at 08:43
36

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

PepsiGoose
  • 377
  • 3
  • 4
19

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

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Marcus
  • 1,857
  • 4
  • 22
  • 44
12

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);
Demodave
  • 6,242
  • 6
  • 43
  • 58
  • 1
    IntroduceInstabilityByIgnoringProtectedModeSettings and RequireWindowFocus is no longer available in IEDriverServer 3.14.0. Instead use "disableNativeEvents()". – Jimmy Garpehäll Sep 25 '19 at 06:55
7

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.

JonathanDavidArndt
  • 2,518
  • 13
  • 37
  • 49
Viet Pham
  • 214
  • 2
  • 5
  • 1
    Even in the current version (3.6.0), this really does work, with no obvious side effects... except that now Protected Mode is on for all zones! This is a good answer, but the solution itself is poor, as having Protected Mode on for all zones breaks many sites (in my case, this includes several brittle internal vendor products). – JonathanDavidArndt Oct 07 '17 at 03:07
3

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.

wwerner
  • 4,227
  • 1
  • 21
  • 39
2

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

Source: WebDriver and IE10 very slow input

Community
  • 1
  • 1
Jamie Rees
  • 7,973
  • 2
  • 45
  • 83
2

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.

Vivek Singh
  • 3,641
  • 2
  • 22
  • 27
1

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

Srikanth Gurram
  • 1,022
  • 1
  • 10
  • 22
1

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.

Jimmy Garpehäll
  • 453
  • 5
  • 15
0

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")

ddavison
  • 28,221
  • 15
  • 85
  • 110
0

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!

Tom Fuller
  • 5,291
  • 7
  • 33
  • 42
S Kotra
  • 81
  • 2
0

Disable NATIVE_EVENT resolved my issue

 DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
 capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
 driver = new InternetExplorerDriver(capabilities);
Naren Chejara
  • 1,124
  • 10
  • 7
0

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

0

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

Nisim Naim
  • 151
  • 1
  • 15
0

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.

0

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!

Michal
  • 90
  • 1
  • 2
  • 5
-2

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);
vaultah
  • 44,105
  • 12
  • 114
  • 143