This repository has been archived by the owner. It is now read-only.

After installing Windows Update KB 3025390 IEDriverServer.exe does not execute JavaScript #8302

Closed
lukeis opened this Issue Mar 4, 2016 · 53 comments

Comments

Projects
None yet
1 participant
@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 8302



What steps will reproduce the problem?
1. Install the Windows Server 2012 R2 patch for IE11 at http://support.microsoft.com/kb/3025390

2. Write a Selenium C# console app which uses IEDriverServer.exe to execute some JavaScript.
I have sample code below which should repro the issue:

        static void Main(string[] args)
        {
            try
            {
                OpenQA.Selenium.IE.InternetExplorerOptions option = new OpenQA.Selenium.IE.InternetExplorerOptions();
                option.EnableNativeEvents = true;
                option.RequireWindowFocus = true;
                option.UnexpectedAlertBehavior = OpenQA.Selenium.IE.InternetExplorerUnexpectedAlertBehavior.Accept;
                option.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
                OpenQA.Selenium.IE.InternetExplorerDriverService service = OpenQA.Selenium.IE.InternetExplorerDriverService.CreateDefaultService();
                var Driver = new OpenQA.Selenium.IE.InternetExplorerDriver(service,
option);
                Driver.Manage().Timeouts().SetPageLoadTimeout(new TimeSpan(0, 0, 30));
                Driver.Manage().Cookies.DeleteAllCookies();
                IJavaScriptExecutor executor = Driver as IJavaScriptExecutor;
                string s = executor.ExecuteScript("return navigator.userAgent;").ToString();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }
3. Run the app and you should receive an exception throw by WebDriver after it receives
its response from IEDriverServer:
  System.InvalidOperationException: JavaScript error (UnexpectedJavaScriptError)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)

Uninstalling the KB patch allows IEDriverServer to function again.


Selenium version:
OS: Windows Server 2012 R2
Browser: IE 
Browser version: 11.0.9600.17498

Note: This does not repro on Windows 8.1


Reported by mikedirl@mikeandterra.com on 2014-12-19 02:24:49

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Selenium version was 2.44

Reported by mikedirl@mikeandterra.com on 2014-12-19 02:26:22

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Reported by barancev on 2014-12-19 07:24:05

  • Labels added: Browser-IE
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Leaving aside for the moment that running a browser on a server platform is not a likely
scenario, and is explicitly discouraged by the developer of the operating system, are
the capabilities you're passing in required for this to reproduce? In other words,
has the browser been configured properly for use with WebDriver such that the IntroduceInstability...
capability is no longer required?

Reported by james.h.evans.jr on 2014-12-19 11:32:02

  • Status changed: NeedsClarification
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

The browser was configured correctly for all the options I am using, but the error reproduces
with just the following simple code anyway:

    var Driver = new OpenQA.Selenium.IE.InternetExplorerDriver();
    IJavaScriptExecutor executor = Driver as IJavaScriptExecutor;
    string s = executor.ExecuteScript("return navigator.userAgent;").ToString();

I would contend that your statement about Windows explicitly discouraging IE on a server
platform is not true. While I would agree that it is not a common end user scenario,
Internet Explorer is a supported product on Windows Server, and the KB article I linked
has a very specific link for Windows Server. I know a lot of developers who are using
Server as their dev and test environment where everything is run local for debugging
purposes (which is where I ran into this issue).

Thanks,
Mike


Reported by mikedirl@mikeandterra.com on 2014-12-19 18:12:13

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I can repro this issue on Windows 8.1 after installing the IE11 update KB3025390.

I believe it is this line of code (https://code.google.com/p/selenium/source/browse/cpp/iedriver/Script.cpp#484)
that is failing. It seems after installing the IE update, IHTMLWindow2.execScript would
not work anymore.

According to the IE 11 compatibility documentation (http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx),
IE 11 has removed the ITHMLWindo2.execScript API. But for some reason it did not totally
block the call. One could not run window.execScript from the IE F12 Developer Tools
console, but calling via COM interface seemed to be working. Until the recent KB3025390
update, which has completely shut down this API...

Reported by tonyblu.cn on 2014-12-19 18:38:56

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I knew this break would happen eventually, but I though we might be able to squeak by
for the entirety of the IE11 release cycle.

Reported by james.h.evans.jr on 2014-12-19 19:11:30

  • Status changed: Accepted
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I also saw this today on a Windows 7 Enterprise, IE11 VM that I downloaded from https://www.modern.ie/en-us.
All of my IE11 tests passed on Wednesday and all of them failed/skipped today. Running
Selenium 2.43.1. 

Reported by keithu9999 on 2014-12-19 21:25:24

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8305 has been merged into this issue.

Reported by james.h.evans.jr on 2014-12-19 22:43:36

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Reported by james.h.evans.jr on 2014-12-19 22:45:01

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

It must be pointed out that the effects of this issue are far-reaching. The effects
are not limited simply to executing JavaScript. This will affect virtually every part
of the IE driver, rendering it useless against IE11. There is no known workaround at
this time except possibly uninstalling the update. The issue is not limited to the
driver's use of the IHTMLWindow2::execScript method; it occurs when using eval as well
from the driver. The issue is being further investigated. 

Reported by james.h.evans.jr on 2014-12-19 22:52:17

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

A bug report[1] (yes, complete with compilable stand-alone code to reproduce the issue)
has been filed with Microsoft regarding this issue. I am in contact with the IE team
there, working to resolve this.

[1] https://connect.microsoft.com/IE/feedback/details/1062093/installation-of-kb3025390-breaks-out-of-process-javascript-execution-in-ie11

Reported by james.h.evans.jr on 2014-12-22 10:30:17

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8320 has been merged into this issue.

Reported by james.h.evans.jr on 2014-12-22 17:57:56

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

To prevent this update from reinstalling everyday (after uninstalling), do the following:

1. Type and open "Windows Update" from the Start menu
2. Click "Check for Updates" from the options on the left
3. The offending update (KB 3025390) should be available again as an Important Update
4. Click the KB 3025390 update
5. In the new window (showing a check box near the update), right click the update
6. Select the Hide option

Reported by willwitt on 2014-12-23 17:32:19

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I've found a workaround, which essentially undoes one of the changes made by the update,
but I believe it should be used responsibly:

(for 32-bit IEDriverServer):
Change value "iexplore.exe" from 0 to 1 at:
HKLM\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER

Reported by timofey.vasenin@xored.com on 2014-12-23 17:35:44

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

@Timofey's fix worked for me.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001

Reported by jsimmons@jeremysimmons.net on 2014-12-23 19:14:11

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8316 has been merged into this issue.

Reported by james.h.evans.jr on 2014-12-30 05:40:34

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8340 has been merged into this issue.

Reported by james.h.evans.jr on 2014-12-30 05:41:10

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Current guidance from the IE team at Microsoft is to *NOT* use the registry to disable
the security manager. Once again, Microsoft is aware of the issue, and it affects far
more than just the IE driver or the Selenium project.

Reported by james.h.evans.jr on 2015-01-05 09:11:27

  • Labels removed: Status-Untriaged
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8358 has been merged into this issue.

Reported by james.h.evans.jr on 2015-01-05 13:22:04

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Can this affect other browsers like Chrome/Firefox? After un-installing it from my Win7
box, I started hitting java script issues on these browsers.

Reported by jatinhpatel on 2015-01-08 19:48:26

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

In general, no. This should not effect non-IE browsers.

Reported by james.h.evans.jr on 2015-01-08 22:04:55

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I have found a way around this problem , if this update is getting installed automatically
. you can just create a simple batch file with following content.

@echo off
wusa /uninstall /kb:3025390/quiet /norestart
END

Then go to task scheduler, create a new task for this batch file to run at every one
hour or daily as u find suitable. Make it as a system task so it will run in background
and wont effect the running automation's. 

Reported by niksbijnor on 2015-01-12 05:26:10

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

@niksbij:  Timofey posted a simpler quick hotfix for preventing re-installation. I will
repost it here, so others dont have to look for it.

To prevent this update from reinstalling everyday (after uninstalling), do the following:

1. Type and open "Windows Update" from the Start menu
2. Click "Check for Updates" from the options on the left
3. The offending update (KB 3025390) should be available again as an Important Update
4. Click the KB 3025390 update
5. In the new window (showing a check box near the update), right click the update
6. Select the Hide option

Reported by minijag on 2015-01-12 16:39:45

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

@mini .. 

Actually I am using Selenium on client server which comes under the group policy. So
hiding the update was not helping it was getting installed after every 72 hours. 
That's why i looked for another approach rather uninstalling it after every 72 hours.
So I made this simple scheduling task. 

Reported by niksbijnor on 2015-01-13 04:48:25

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8452 has been merged into this issue.

Reported by barancev on 2015-02-13 08:13:49

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

@Timofey's fix worked for me.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER]
"iexplore.exe"=dword:00000001

Reported by pradeep.gonaguntla1 on 2015-02-16 16:45:49

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

@pradeep, can you mention system setup, OS, Browser version?

Tested Timofey's Windows Registry Editor fix, no change from previous post;

>>
OS: Windows Server 2012 R2
No available Windows Updates

Browser: Internet Explorer 11
Browser Version: 11.0.9600.17631
Update Versions: 11.0.16 (KB3021952)

Selenium version: 2.44

Using Selenium Grid, browser loads, navigate commands work, when attempting to find
elements I get exceptions.

Reported by CoolGuyJanaR on 2015-02-17 15:42:50

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Installing the Feburary 2015 Cumulative Update for Internet Explorer (https://support.microsoft.com/kb/3021952)
resolves this issue. People experiencing further issues on IE11, with this update installed,
which do not reproduce on other versions of IE should open new issue reports.

Reported by james.h.evans.jr on 2015-02-17 17:13:35

  • Status changed: Fixed
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

OS: Win7

Browser: Internet Explorer 11
Browser Version: 11.0.9600.17633
Update Versions: 11.0.16 (KB3021952)

IEDriver version: 2.44.0

Using IMPLEMENTATION=VENDOR, we are not able to get this IEDriver version working with
out selenium based test tool, with or without microsoft webdriver tool.

I can see the driver IMPLEMENTATION set to VENDOR in the log, it also brings up the
browser, but gets stuck there.

Question is, if it is a known issue with this version of IEDriver? If so, when is the
bug fix release out?

Reported by tanvi.gour on 2015-02-23 15:31:03

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issues encountered when attepmting to use the Microsoft implementation of WebDriver
are entirely unrelated to this issue. For a more detailed discussion, I would encourage
you to join the IRC channel (#selenium on Freenode).

Reported by james.h.evans.jr on 2015-02-23 16:44:04

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8371 has been merged into this issue.

Reported by barancev on 2015-03-02 22:07:23

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8414 has been merged into this issue.

Reported by barancev on 2015-03-08 21:13:11

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Issue 8410 has been merged into this issue.

Reported by barancev on 2015-03-08 21:19:36

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I've encountered this issue.  System Data:
Windows 7 Home Premium SP1
IE version 11.0.9600.17691
Selenium version 2.45.0
IE Driver(64 bit) version 2.45.0

Error Message:
org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window
(WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'Manannan', ip: '192.168.0.126', os.name: 'Windows 7', os.arch:
'amd64', os.version: '6.1', java.version: '1.8.0_31'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver

Reported by Gaerdel on 2015-03-24 22:39:30

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I very strongly disagree with comment #45.  This is *not* fixed.  I installed a fresh
version of Windows 8.1 x64 in VMWare, and then repeatedly ran Windows Update and rebooted
until no more updates were listed.  I don't have KB3025390 or KB3021952 installed,
but this is presumably because they are both replaced by the latest cumulative update
KB3032359.

I have the *exact* issue described here.  I get a WebDriverException JavaScript error
when I try to execute javascript on the target page.  This happens for both remote
and local pages, and even with the Windows firewall turned off.

(I also tried both the x64 and 32-bit versions of the IEDriver (2.45) with no difference.)

Why do I need to file a new issue when it's exactly the same as all the other users
report here, except that it hasn't been fixed.

Reported by bobbitdiddle on 2015-04-09 08:00:49

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Why file a new issue? Because the root cause of this issue is different than the one
described here. The root cause of *this* issue is that Microsoft broke the driver with
a Windows update. This root cause was verified *by them*. Additionally, the symptom
you're describing isn't being experienced anymore by many, many users of the IE driver,
including the project dev team. If, after installing their fix (or the subsequent one,
as you pointed out), you're still experiencing the same symptom, you must be experiencing
a different issue.

Reported by james.h.evans.jr on 2015-04-09 09:59:12

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

KB described in #45 comment is for Win 8.1 users , somebody have info about Win 7.1
? I tried ALL suggestion listed in this ticket and still have same error in Win 7.1
, I am not able to install KB3021952 because it is for Win 7.1  

Reported by edrozim on 2015-06-01 15:14:23

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Same error here:
org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not
provide any stacktrace information)

With:
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10'
... os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_40'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver

And with:
18:11:53 Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10'
... , os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version:
'1.7.0_45'

I tried the regedit modifications of FEATURE_BFCACHE and FEATURE_DISABLE_INTERNAL_SECURITY_MANAGER
and 'any kind' of capabilities but with no look.

Also I can't install the KB3021952.

Please help me. As it is very urgent for me.

Reported by sergio@sacristan.com.es on 2015-08-01 16:41:05

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

I am running into same issue on IE 11.0.9600.17728. Update: 11.0.18

I do not have any of these updates installed on Windows server R2 64 bit. Still getting
same error. I tried various solution listed above.

I see this is a fixed. Not sure which one is the solution.... HELP PLEASE!

Reported by sst.shrikant on 2015-09-16 13:50:29

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:24:58

  • Labels added: Restrict-AddIssueComment-Commit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.