Selenium: Invalid “already running” error when starting server

后端 未结 15 2188
名媛妹妹
名媛妹妹 2021-01-31 02:32

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

相关标签:
15条回答
  • 2021-01-31 03:15

    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!

    0 讨论(0)
  • 2021-01-31 03:17

    Thanks,

    The link of Andre works fine for me.

    As 4444 is the default port of Selenium check this as well.

    0 讨论(0)
  • 2021-01-31 03:19

    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.

    0 讨论(0)
  • 2021-01-31 03:19

    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.

    0 讨论(0)
  • 2021-01-31 03:27

    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
    
    0 讨论(0)
  • 2021-01-31 03:28

    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.

    0 讨论(0)
提交回复
热议问题