I am trying to get the Selenium server up and running. However, when I type:
java -jar selenium-server-standalone-2.0b3.jar
I get an Exception
If you started Selenium using Java (instead of via whatever testing framework you may or may not be using), you can kill all leftover Selenium instances with:
pkill java
That's guaranteed to kill any java relics (including selenium if started this way) - but be careful here - caveat is that you might be killing other procs too (due to the way pkill works). In my case, I want to kill anything running in the JVM, so this solved it for me.
As per the comment from Goldberg below, note that this will not kill any driver services or browsers running on your system!
Thanks,
The link of Andre works fine for me.
As 4444 is the default port of Selenium check this as well.
If you are using Windows, you can open the task manager and locate the java.exe or javaw.exe process and kill it. This will release port 4444 and you should be able to restart the Selenium server.
That ERROR Server Exception: sessionId should not be null; has this session been started yet?
message comes from Selenium. If you're seeing it, there's a Selenium server running on that port number.
I had the same error but no server was running. Tuned out the java version was in cause. Make sure you are running java 7 or higher:
java -version
The error message Selenium offers up is a little confusing. It really should be telling you you're making a syntax error. I had this problem as well. Make sure the cmd string is PRECISELY like this:
http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
That means using the full command shutDownSeleniumServer
, and make sure the s
in shut
is lower-case (That was my mistake).
Hope this helps.