d5111
d5111

Reputation: 115

selenium Exception

How to solve this exception

Root element Configuration

5 Jan, 2011 4:21:59 PM com.ensarm.niidle.util.logger.NiidleLogger log
SEVERE: ERROR Server Exception: sessionId should not be null; has this session been started yet?
com.thoughtworks.selenium.SeleniumException: ERROR Server Exception: sessionId should not be null; has this session been started yet?
    at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
    at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335)
    at com.ensarm.niidle.web.proxy.navigators.BasicProxyNavigator.openProxy(BasicProxyNavigator.java:131)
    at com.ensarm.niidle.web.proxy.navigators.AnonymitaComProxyNavigator.initialize(AnonymitaComProxyNavigator.java:25)
    at com.ensarm.niidle.web.proxy.navigators.AnonymitaComProxyNavigatorTest.testInitialize(AnonymitaComProxyNavigatorTest.java:67)
    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Upvotes: 1

Views: 8599

Answers (4)

Ranadheer Reddy
Ranadheer Reddy

Reputation: 4324

That errors comes if the selenium server is not started. You have to start server.

And then execute the statement selenium.start();.

Upvotes: 0

Amit Shakya
Amit Shakya

Reputation: 1476

Run this script in browser http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer Actually selenium RC takes port: 4444 as default. Sometime program gets interrupted before executing tearDown(or closing the port).

Upvotes: 0

I've notice that this exception is thrown when selenium client tries to execute actions against a Selenium RC which browser have been closed.

Selenium RC assigns a session ID for each client as you can see in this excellent post: http://www.touspassagers.com/2010/11/exposing-the-selenium-browser-session-id/

Cheers, Daniel

Upvotes: 2

rbrayb
rbrayb

Reputation: 46720

Are you running Selenium IDE or RC?

If Selenium RC, then I have noticed this kind of exception when the instance is not correctly created e.g. you need:

selenium = new DefaultSelenium ( ... )
selenium.start ();
selenium.open ( ... )

Upvotes: 6

Related Questions