Automation, Exception, Internet Explorer, Java, Selenium, Selenium Errors, Selenium grid, Testing, Web Automation, Web Testing

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

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

  • I started a selenium hub at my local by this command:
java -jar selenium-server-standalone-2.41.0.jar -role hub -port 1111
  • 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/
  • 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/); }
  • You will get the above error.

Resolution

  • 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

  • Once you are done with this, then you are perfectly ready to run your tests.
  • Go on and click on RUN, and tests will run as expected.
Advertisements

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

  1. You share interesting things here. I think that your website can go viral easily, but you must give it initial boost and i know how to do it, just type in google – omgerido
    trafic method

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s