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

Unexpected error launching Internet Explorer. Protected Mode must be set to the same value #1795

Closed
lukeis opened this Issue Mar 2, 2016 · 66 comments

Comments

Projects
None yet
1 participant
@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 1795

Using Selenium 2.0rc2, I'm seeing the following exception when trying to run tests using
IE:

Caused by: org.openqa.selenium.WebDriverException: Unexpected error launching Internet
Explorer. Protected Mode must be set to the same value (enabled or disabled) for all
zones. (WARNING: The server did not provide any stacktrace information)
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.6.0_25'
Driver info: driver.version: InternetExplorerDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:103)
    at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:104)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:61)

It looks like protected mode is set in IE on my machine via a corporate group policy
that I'm not a part of and therefore not able to change.  I have a feeling I'm likely
not the only one out there under this restriction, and fairly confident that my organization
as well as others would not be willing to bend on this restriction for a mass amount
of people.

Is this requirement totally necessary or is it something that can be worked around?

Reported by nsa.lummox on 2011-06-08 17:11:06

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

That was me reporting before, just used the wrong email address..

I looked at the JavaDoc and tried to use what appears to be the quasi-desirable workaround:

DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();  ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true);
WebDriver driver = new InternetExplorerDriver(ieCapabilities);

After doing this, I see an IE window that says it's the base WebDriver window (progress!),
but then immediately after I see a big nasty stacktrace:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10003280, pid=2284, tid=1880
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) Client VM (20.0-b11 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  0x10003280
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Reported by ian.g.simpson on 2011-06-08 17:25:27

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Does the problem you're experiencing happen on the line of code creating the InternetExplorerDriver
(i.e. the line that reads "WebDriver driver = new InternetExplorerDriver(ieCapabilities);"),
or does the crash happen when attempting to execute the next line of code?

Reported by james.h.evans.jr on 2011-06-08 17:53:07

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

It's a sign of flakiness you've asked to introduce :)

Corporate policies are good for workstations and production servers, in a test lab
you'd better have some additional abilities to change computer settings, install additional
software, monitor system logs etc. Try to explain to your boss that you need a special
policy for the test lab.

Reported by barancev on 2011-06-08 18:03:24

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

My bad, I should have included the rest of the stack trace.

Instantiating the driver passes with the override in place.  The crash happens when
I try to actually use it:

org.openqa.selenium.NoSuchElementException: Unable to find element with id == search-input
(WARNING: The server did not provide any stacktrace information)
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.6.0_25'
Driver info: driver.version: RemoteWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:192)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:209)
    at org.openqa.selenium.By$ById.findElement(By.java:199)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:184)
    at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:58)
    at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:35)
    at $Proxy31.sendKeys(Unknown Source)

My code is calling driver.get to load our home page, and then uses PageFactory to initialize
a WebElement bound to id=search-input.  I'm not seeing IE ever load the homepage though
which would explain the exception.

Reported by ian.g.simpson on 2011-06-08 18:05:06

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I'm working on talking to our corporate systems people to see what can be done about
this.  We are given the ability to be local system administrators so that we can install
tools, but this particular setting is beyond what can be changed.  We may end up setting
up an additional group to circumvent the issue.

Reported by ian.g.simpson on 2011-06-08 18:07:49

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Talked to the corporate systems folk, and it sounds like my organization may have hit
an impasse on this issue.

My initial thought was that we could set protected mode as enabled for all zones, as
we don't want to have it disabled on individual workstations for external access. 
However, as it turns out we have internal applications that don't work if protected
mode is turned on for internal sites.  We also discussed having test machines separate
from workstations that could be remotely accessed, but there's the logistical complication
of people needing to have their IDE/Maven and such set up in such a way.

Our corporate systems team is going to talk to our security team on the issue and get
back to me.  In the meantime, I'm still curious to figure out what's happening when
flakiness == 1, because not even loading the page is beyond just being flaky.

Reported by ian.g.simpson on 2011-06-08 20:40:07

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016


Hi

I have the same problem also when using Selenium 2.0rc2. I am running it on Windows
7 IE8 and VS2010. In my system I and disable UAC and also protection mode in IE8. But
i still see this issue.

System.InvalidOperationException: Unexpected error launching Internet Explorer. Protected
Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
990
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(DriverCommand driverCommandToExecute,
Dictionary`2 parameters) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
801
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
769
   at OpenQA.Selenium.IE.InternetExplorerDriver..ctor() in 

When i revert the dll to Selenium 2.0b3 i do not see this issue. I hope a fix will
for this soon.


Reported by t1279k on 2011-06-09 05:48:01

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

also the error comes up when executing IWebDriver driver = new InternetExplorerDriver();

Reported by t1279k on 2011-06-09 05:49:21

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

About a year ago, the IE driver was rewritten from the ground up. This rewrite is what
caused the need to manage the Protected Mode settings of IE. A good discussion of why
this requirement for mananging Protected Mode can be found in the Selenium developers
mailing list archive. The specific thread containing this disucssion can be found at
http://groups.google.com/group/selenium-developers/browse_thread/thread/4dd6330f97bd2312/3e904642ac3dac6?q=
.

The only new information from that thread is that we have discovered where in the registry
the Protected Mode settings are stored and can check the settings thereof. Passing
the flag in the Capabilities object merely bypasses the registry check. In short, when
crossing a Protected Mode boundary, the COM object that the IE driver is connected
to becomes orphaned. This is by design in IE from version 7 onward and Microsoft has
made it impossible to be worked around, disabled, or ignored.

If you're truly interested in what the code is doing, look at BrowserFactory.cpp in
the project sources. That's where IE instances are created and attached to.

Reported by james.h.evans.jr on 2011-06-09 11:03:36

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Reverting to the Selenium 2.0b3 dlls will eliminate the error, because the registry
check was not in place until 2.0rc1. I absolutely do *NOT* recommend disabling UAC.
If you re-enable UAC, and reset Protected Mode for each zone (in IE, Tools > Internet
Options > Security tab, checkbox at the bottom of the dialog labeled "Enable Protected
Mode"), what happens?

Reported by james.h.evans.jr on 2011-06-09 11:11:53

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

After re-enable UAC, and reset Protected Mode for each zone I still get the same error.

Reported by t1279k on 2011-06-09 14:07:53

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Setting it to the same value fixed the issue, but this problem is exceedingly complicated
for my organization.  I needed to have another user account created, as the way our
infrastructure is set up these permissions are bound to the account itself and not
a group.  I had to have another account created because changing my master account
would have locked me out of a litany of important services.

I understand that you are at the behest of what Internet Explorer provides you, but
I have a feeling this is going to cause us some issues.

Reported by nsa.lummox on 2011-06-13 20:41:52

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I understand the issue, and I am sympathetic. I'm open to suggestions how to solve the
problem, and I'm happy to provide guidance into the architecture of the C++ code if
you want to try to refactor that code in such a way as to solve the problem in a different
way. You may be able to work around the problem by clever manipulation of the places
the browser visits so that you never cross a Protected Mode boundary, but I think you're
going to find that exceedingly difficult too.

Reported by james.h.evans.jr on 2011-06-13 21:03:11

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I have a request in for permission to work on this open source project with my employer,
so I may dig into it to see if I can help in any way.  Based on what you guys have
said so far, it sounds daunting to say the least.  It seems like our site ends up in
mixed mode quite often, so I don't know if I'd be able to set up the tests to avoid
the issue.

Reported by ian.g.simpson on 2011-06-13 21:22:29

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

By the way, my issue of not finding the element with flakiness = 1 above was due to
my own ignorance, and was not a fault of web driver. :)  Still trying to find a way
to work around the protected mode thing within my organization though.

Reported by ian.g.simpson on 2011-06-13 21:31:06

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Hi Ian

How did you get it working. In my org i can change security setting as i like but i
still get the same issue. What are the settings did you do to get selenium to work.
I am getting error even after enabling UAC. 
What did you mean by "Setting it to the same value fixed the issue". It would be greatly
help full what you had done to make it work.

did you create ur script using java & eclipse or C# & VS2010.  

Thanks
Tk

Reported by t1279k on 2011-06-14 06:06:03

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

@Tk Either the zone settings are not set correctly, or our check of the registry is
incorrect. You can also add the "ignoreProtectedModeSettings" capability to a DesiredCapabilities
object to bypass the zone setting check. This is not really the appropriate forum for
real-time troubleshooting. I would suggest hopping on the IRC channel. You could also
check the registry yourself to see what the values are that we are checking.

Reported by james.h.evans.jr on 2011-06-14 09:59:21

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I have the same issue. Protected mode is disabled. 
IE9 + Win 7 + C# + VS 2010
source code:
 IWebDriver driver = new InternetExplorerDriver();
 driver.Navigate().GoToUrl("http://google.com");
 driver.Close();

Additional Information here:

System.InvalidOperationException was unhandled by user code
  Message=Unexpected error launching Internet Explorer. Protected Mode must be set
to the same value (enabled or disabled) for all zones. (NoSuchDriver)
  Source=WebDriver.Remote
  StackTrace:
       at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
990
       at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(DriverCommand driverCommandToExecute,
Dictionary`2 parameters) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
801
       at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
769
       at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,
ICapabilities desiredCapabilities) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
63
       at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities
desiredCapabilities) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Remote\RemoteWebDriver.cs:line
80
       at OpenQA.Selenium.IE.InternetExplorerDriver..ctor(Int32 port, ICapabilities
desiredCapabilities) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.IE\InternetExplorerDriver.cs:line
85
       at OpenQA.Selenium.IE.InternetExplorerDriver..ctor(Int32 port) in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.IE\InternetExplorerDriver.cs:line
66
       at OpenQA.Selenium.IE.InternetExplorerDriver..ctor() in e:\Projects\WebDriver\trunk\dotnet\src\WebDriver.IE\InternetExplorerDriver.cs:line
57
       at QuestUITests.SampleCodedUITests.FindElement() in C:\QA Automation Moscow\Shared
Resources\Coded UI Tests\Shared Library\Current\QA.CodedUITest\SharedCodeLibrary\SampleCodedUITests.cs:line
25
  InnerException: 

Reported by Mochalin.Igor on 2011-06-14 12:39:08


- _Attachment: 1.png
![1.png](https://storage.googleapis.com/google-code-attachments/selenium/issue-1795/comment-19/1.png)_
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Look in your registry under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Zones key. Under there, you should see keys number 0-5. Under keys 1-4, look
for a value named 2500, and list either the value for each of the keys, or if the value
does not exist.

Reported by james.h.evans.jr on 2011-06-14 12:59:32

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Thanks  for your reply  but it doesn't help.
I attached  my reg file 

Reported by Mochalin.Igor on 2011-06-14 13:29:39


- _Attachment: [Zones.reg](https://storage.googleapis.com/google-code-attachments/selenium/issue-1795/comment-21/Zones.reg)_
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

The attached registry file looks at HKEY_LOCAL_MACHINE. You need to look at HKEY_CURRENT_USER.

Reported by james.h.evans.jr on 2011-06-14 14:02:24

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

You are right!  Thanks a lot! it's working!!!

Reported by Mochalin.Igor on 2011-06-14 14:10:25

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I have mine set to enabled for all zones.  I'm using Eclipse 3.6.2 and Java 1.6.

Reported by ian.g.simpson on 2011-06-14 15:44:45

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I had the same problem when run a Java Web Start app.

Fix by:
in section create driver:
        if (browser.endsWith("firefox")) {
            _logger.info("firefox");
            _driver = new FirefoxDriver();
        } else {
            _logger.info("iexplore");
            DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
            ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true);
            _driver = new InternetExplorerDriver(ieCapabilities);
        }

In jnlp:

<extension name="JavaCL"
            href="http://nativelibs4java.sourceforge.net/webstart/OpenCL4Java/JavaCL.jnlp"
/>

Thanks for all support!

Reported by tungmiho on 2011-06-17 10:04:50

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

It was working for me in 2.0b3.

Reported by pioter.jagielski on 2011-07-01 18:49:04

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Also what does this mean 

Feb 29, 2012 5:37:09 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Software
caused connection abort: recv failed
Feb 29, 2012 5:37:09 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request

Reported by shabazia09 on 2012-02-29 17:38:01

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

When i try to launch the selenium im getting the following exception

02-Apr-2012 11:37:59 org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Software
caused connection abort: recv failed
02-Apr-2012 11:38:00 org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request

I tried to resolve the error by turning on the Protected mode in IE and still no luck.
I'm using windows 7 and selenium-java 2.16.1 jar with selenium-ie 2.16.1 jar file.
The piece of code when it crashes is 

InternetExplorerDriver driver = new InternetExplorerDriver();

The next piece of line is not getting executed. Please provide an solution for this
or comment if additional details is required.

Reported by talkwithkrishna on 2012-04-02 10:47:21

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I get the "Protected Mode must be set to the same value" error randomly. IE9, Win7.
I have all zones set to Protected Mode On. I run my selenium test and it terminates
almost immediately. Change nothing, start the test again, and it runs fine. Start the
test again and the failure occurs.

Looking though the BrowserFactory.cpp code, I note that there's error handling in the
GetZoneProtectedModeSetting if the registry key read fails. Why that might happen I
don't know, but it might be better to report such a failure separately as with the
current behaviour it's very hard to see whether that might be what's wrong.

Also, to me the result of the error handling for GetZoneProtectedModeSetting looks
wrong: it's returning value 3 for when the default mode is on, and 0 for off. But inspecting
the registry seems to indicate the 0 = on and 3 = off.

Reported by nicholas.f.stimpson on 2012-04-20 10:42:47

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

@43 please file a new issue

Reported by dawagner on 2012-04-21 22:53:51

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Did we get this sorted out ....

Has someone raised a new issue 

Reported by cftestdumb on 2012-04-30 16:00:11

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

@43 You're right. The logic is backward for installations where the value in the registry
doesn't exist. This is, in my experience, a pretty rare case, usually only on brand-new
virgin installations of Windows. Nevertheless, I've corrected the logic as of r16751.
Additionally, if you've checked the code in BrowserFactory.cpp since r16733, you'll
notice that various error conditions now report different error strings, so it should
be easier to diagnose where the issue is occurring.

Reported by james.h.evans.jr on 2012-04-30 17:18:07

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
        ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);


WebDriver dr = new InternetExplorerDriver(ieCapabilities);

Reported by nikil027 on 2012-05-03 07:24:01

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Add the below snippet works fine

By ignoring the protected mode settings 

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

Reported by shabazia09 on 2012-05-23 13:43:55

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

This feature works as intended, and the workaround in comment 48 is the right one.

Reported by simon.m.stewart on 2012-05-28 16:03:47

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

@29 & @30. You people told that after Turned on the Protected mode,its working for you,
but when i changed the setting to Default in Security tab, i am getting the same error.
Please find the code below.

log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.openqa.selenium.WebDriverException: Unexpected error
launching Internet Explorer. Protected Mode must be set to the same value (enabled
or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 11.64 seconds
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version:
'1.6.0_31'
Driver info: driver.version: InternetExplorerDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:175)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:128)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:459)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:140)
    at org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:113)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:52)
    at Example.Script.main(Script.java:13)

Please help me on this issue.

Reported by thotamahesh2k on 2012-12-04 12:50:00

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I am using windows XP and IE8 in my system. so I am not getting the Enable Protected
Mode Option. Can anyone suggest me workaround on this....

Reported by thotamahesh2k on 2012-12-04 13:09:51

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

I second the previous question. We are on Windows XP and do not have the Enable Protected
Mode Option. What should we do in this case?

Reported by ragamufin on 2013-03-08 00:28:06

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

If you're running XP, I've repeatedly asked for a log at either the debug or trace levels
from IEDriverServer.exe so that I can diagnose the issue. No such log has been forthcoming.
If you're using the Java language bindings, you can change the logging level by setting
the appropriate attributes on the InternetExplorerDriverService, using the Builder
class (InternetExplorerDriverService.Builder). 

Reported by james.h.evans.jr on 2013-03-08 01:47:35

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

win 7, ie 9. Set all zones ( 4 tabs) protected mode on. And the problem is gone.

Reported by ron.g.second on 2013-04-18 13:24:16

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Look in your registry under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Zones key. Under there, you should see keys number 0-5. Under keys 1-4, look
for a value named 2500, and list either the value for each of the keys, or if the value
does not exist.

thanks,my problem is solved.

Reported by lqemailbox.vip on 2013-06-24 07:22:29

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

未处理System.InvalidOperationException
  HResult=-2146233079
  Message=Unexpected error launching Internet Explorer. Protected Mode settings are
not the same for all zones. Enable Protected Mode must be set to the same value (enabled
or disabled) for all zones. (NoSuchDriver)
  Source=WebDriver
  StackTrace:
       在 OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行号 1058
       在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) 位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行号
849
       在 OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行号 814
       在 OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,
ICapabilities desiredCapabilities) 位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:行号
90
       在 OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService
service, InternetExplorerOptions options, TimeSpan commandTimeout) 位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\IE\InternetExplorerDriver.cs:行号
142
       在 OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService
service, InternetExplorerOptions options) 位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\IE\InternetExplorerDriver.cs:行号
130
       在 OpenQA.Selenium.IE.InternetExplorerDriver..ctor(InternetExplorerOptions options)
位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\IE\InternetExplorerDriver.cs:行号
86
       在 OpenQA.Selenium.IE.InternetExplorerDriver..ctor() 位置 c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\IE\InternetExplorerDriver.cs:行号
76
       在 SelenuimWebTest.Program.Main(String[] args) 位置 c:\Users\danda_000\Documents\Visual
Studio 2012\Projects\SelenuimWebTest\SelenuimWebTest\Program.cs:行号 21
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Reported by azaas2013 on 2013-07-31 04:56:08

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

#55's reply have helped me with the same problem.Thanks.

Reported by liqq0526 on 2013-11-19 08:10:29

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

thanks #29, it works for me! selenium2.39+IE9+win7+x64+eclipse4.20+jdk1.7

#29 gcros...@gmail.com
If you turn ON protected mode in ALL Internet Explorer Zones (Security Tab in IE settings)
I believe the issue is resolved.

Reported by sandy.sunjingxin on 2014-01-09 06:44:03

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Hi, I'm having issues similar to the original poster;

I work for a company that enforces zone settings via Domain Policy/GPO. Our application
is a webapp that is currently IE-only (although we're looking to change that, thus
why I was tasked with investigating Selenium), and requires that Protected Mode be
disabled, and our site added as a Trusted Site in IE.

Our domain settings, however, leave Protected Mode on for the regular Internet zone;
our Security team will not budge on this, nor should they have to.

I've tried the following to bypass the registry check, but it doesn't seem to work.

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;

(I'm writing in C#, not Java.)

Are there any other options to get this to work?

Reported by veruszetec on 2014-05-21 19:15:25

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

No. As discussed in multiple other places, including comments on this issue, there is
no other way around this issue. The reasons for this behavior in the IE driver are
technical, and well-documented. In other words, they are not arbitrary, put there to
frustrate you or your IT department. However, in point of fact, yes, they should be
expected to change their policy, if the expect WebDriver code to work with IE. The
technical reasons are documented in a post on the blog at http://jimevansmusic.blogspot.com.
As I also mentioned in comment #14, I'm willing to review any patches to the IE driver
that you believe would fix the issue.

Reported by james.h.evans.jr on 2014-05-21 20:36:08

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Thanks, I was wondering if there may have been any developments since the last post
on this thread was a few years old.

Reported by veruszetec on 2014-05-21 20:48:44

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Hi All,
You can use the below snippet.

                System.setProperty("webdriver.ie.driver",System.getProperty("user.dir")+"\\Drivers\\IEDriverServer.exe");
                //driver = new InternetExplorerDriver();
                DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
                capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
                driver = new InternetExplorerDriver(capabilities);
                driver.manage().window().maximize();

Reported by kounain.shahi@osscube.com on 2014-06-23 07:08:34

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

yup. Thanks. I resolve my issue with IE with above suggestions

Reported by swapnat1999 on 2014-10-16 20:50:46

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Hi All, I use IE 8 on WIndows Server 2008. Even after disabling or enabling protected
mode on all 4 zones I still get this error. How can I resolve this issue without using
the INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS flag? Thots?

Reported by balaji.gandhi on 2014-12-30 01:15:30

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Hello all,

I just fixed this issue in my PC .. i m using Windows 8.1.. My code is as below:

case "ie":
            System.setProperty("webdriver.ie.driver",   
                                      "D:/Prathima/Selenium/IEDriverServer.exe");
            driver = new InternetExplorerDriver();
            openWebPage();
            break;

even I got same errors.. but I fixed them by setting Enable protected mode option in
all levels as shown in attachments. 

Set all zone settings also Enable protected mode.

Reported by prathima.madasu on 2015-02-13 07:57:26


- _Attachment: internet settings.png
![internet settings.png](https://storage.googleapis.com/google-code-attachments/selenium/issue-1795/comment-66/internet settings.png)_
@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

https://selenium.googlecode.com/issues/attachment?aid=17950066000&name=internet+settings.png&token=ABZ6GAdxHsPha9NWMCds6vW6BmRAtPWzBw%3A1434565352256&id=1795&mod_ts_token=ABZ6GAf0T1BhKhH2OLsQk29lNFhZnxc0Qw%3A1434565352256&inline=1

Issue Solved, Thanks

Reported by mallis72 on 2015-06-17 18:25:59

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Grt buddy, after enabling the protected mode in all zones it is worked for me. Thank
you 

Reported by subhash.cvellur on 2015-07-31 07:35:21

@lukeis

This comment has been minimized.

Copy link
Member

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:12:54

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this Mar 2, 2016

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.