My Thoughts: org.openqa.selenium.remote.SessionNotFoundException:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

Saturday, September 21

org.openqa.selenium.remote.SessionNotFoundException:Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

Sometimes when we are trying to load InternetExplorer from WebDriver we will get below error :


org.openqa.selenium.remote.SessionNotFoundException: 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. (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 1.39 seconds
Build info: version: '2.34.0', revision: '11cd0ef', time: '2013-08-06 17:11:28'
System info: os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_09'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver 


This error is because of the security settings in IE. There is a permanent fix to this. :P

>> Open IE , then go to Tools>>Security tab .

>>Now either check or uncheck the "Enable Protected Mode" checkbox for all zones i.e Internet , Local internet, Trusted Sites, Restricted Sites.


We are done . Now start running your script , it will go great  without any issues :) 

9 comments:

  1. i am still facing the same issue....

    org.openqa.selenium.remote.SessionNotFoundException: 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. (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 1.29 seconds
    Build info: version: '2.35.0', revision: '8df0c6bedf70ff9f22c647788f9fe9c8d22210e2', time: '2013-08-17 12:46:41'
    System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_37'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:151)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
    at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:223)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:213)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:179)
    at com.snapdeal.oms.tests.BulkCOD.beforeTest(BulkCOD.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.TestRunner.beforeRun(TestRunner.java:641)
    at org.testng.TestRunner.run(TestRunner.java:609)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1203)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
    at org.testng.TestNG.run(TestNG.java:1036)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

    ReplyDelete
  2. Make sure you have enabled "Protected mode" in all 4 zones.

    The below error will come if and only if the protected mode flag is not same for all zones .

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

    ReplyDelete
  3. Hi Vamshi,

    I am also facing same error. I tried setting as per your instructions, but still the error is same. Following is the info:

    InternetExplorerDriver server (32-bit)2.32.3.0
    Webdriver: version: '2.32.0'
    java.version: '1.7.0_55'
    os.name: 'Windows 7'

    Code:

    System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setBrowserName("iexplore");
    capabilities.setPlatform(org.openqa.selenium.Platform.WINDOWS);
    WebDriver driver = new InternetExplorerDriver(capabilities);
    driver.get("http://www.google.co.in");

    Error:
    Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. IELaunchURL() returned 800700C1 for URL 'http://localhost:29685/' (WARNING: The server did not provide any stacktrace information)

    Note:

    yesterday I tried running webdriver as remote web driver. May be that caused this issue.

    Please help.

    ReplyDelete
  4. Hi,

    I am also facing same error. I tried setting as per your instructions, but still the error is same. Following is the info:

    InternetExplorerDriver server (32-bit)2.32.3.0
    Webdriver: version: '2.32.0'
    java.version: '1.7.0_55'
    os.name: 'Windows 7'

    Code:

    System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setBrowserName("iexplore");
    capabilities.setPlatform(org.openqa.selenium.Platform.WINDOWS);
    WebDriver driver = new InternetExplorerDriver(capabilities);
    driver.get("http://www.google.co.in");

    Error:
    Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. IELaunchURL() returned 800700C1 for URL 'http://localhost:29685/' (WARNING: The server did not provide any stacktrace information)

    Note:

    yesterday I tried running webdriver as remote web driver. May be that caused this issue.

    Please help.

    ReplyDelete
  5. Hi Amit,

    Can you try it with the latest 2.42 IEdriverserver exe file? You can download it from here : http://docs.seleniumhq.org/download/

    I tried below code and it worked.
    WebDriver driver;
    System.setProperty("webdriver.ie.driver","absolutepathOf IEDriverServer.exe ");
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    driver = new InternetExplorerDriver(capabilities);
    driver.get("https://google.com");

    ReplyDelete
  6. Hi Vamshi,


    Thanks for the reply.
    I have already checked with latest drivers, but still error is same.
    On other machines its working. Even it was working on my machine before I tried remotewebdriver.

    ReplyDelete
  7. I tried using latest selenium jar 2.42 as iedriver exe. but still issue is the same.
    Is related to something I tried with remote webdriver?

    ReplyDelete
  8. Hey Amit,

    Sorry I couldn't be of much help .Seems few more also having the same issue like you
    https://code.google.com/p/selenium/issues/detail?id=7420



    Between If you happened to solve it by urself , do let me know the solution :P

    ReplyDelete
  9. Hi Vamshi,


    I too got the similar kind of error , but after changing the setting its working fine ... thank you

    ReplyDelete