top of page

Listening on port 32052:Exception in thread “main” org.openqa.selenium.remote. SessionNo

  • Writer: khyati sehgal
    khyati sehgal
  • Aug 26, 2014
  • 2 min read

ERROR

Started InternetExplorerDriver server (32-bit)
2.42.0.0
Listening on port 32052
Exception in thread "main" 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.21 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '192.168.14.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
 

And some more stack trace

Listening on port 32052:Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer.  Protected Mode settings are not the same for all zone
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:151)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:225)
	at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:181)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:173)
	at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:146)
	at com.xtr.browser.UsingNormalIE.main(UsingNormalIE.java:12)
 

How did I got this error

  1. I started a selenium hub at my local by this command:

java -jar selenium-server-standalone-2.41.0.jar -role hub -port 1111
 
  1. Then I started node with below command.

java -jar selenium-server-standalone-2.41.0.jar -role node -port 1111 -hub <hub-ip>:<hub-port>/grid/register/
 
  1. Then I start running my program.

Use this code snippet:

public static void main(String[] args)
{
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
RemoteWebDriver remoteWD = null;
try{
remoteWD = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"),capabilities);
}catch(MalformedURLException e){
e.printStackTrace();
}
remoteWD.get(http://www.google.com/); }
 
  1. You will get the above error.

Resolution

  1. Start node with below command:

java -jar selenium-server-standalone-2.42.2.jar -role node -hub http://localhost:4444/grid/register -port 5555 -browser browserName="internet explorer,version=7,platform=WINDOWS" -Dwebdriver.ie.driver="F:\IEDriverServer_32.exe 

NOTE: If you want to run your test scripts on IE then you need to set the security mode of your system same for all, like this

  1. Go to Internet explorer.

  2. Go to Settings.

  3. Go to Security.

  4. Now here select ‘Protected Mode’ for all the four icons shown below:

InterNetExplorerProtectedMode
  1. Once you are done with this, then you are perfectly ready to run your tests.

  2. Go on and click on RUN, and tests will run as expected.

Comments


bottom of page