Selenium: Invalid “already running” error when starting server

后端 未结 15 2187
名媛妹妹
名媛妹妹 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:09

    try this:

    lsof -i -n -P | grep 4444
    

    and kill the process it says is on :4444

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

    To shut down the server you can use: http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer

    It will give message OKOK , means it got shutdown. If the server is not running then it will show "This web page not available"

    To check the selenium server status , use this http://localhost:4444/selenium-server/driver/?cmd=getLogMessages

    It will give OK if server is running , if not running then it will show webpage not available

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

    lsof returned no results in my case.

    On a Ubuntu machine I had to do the following:

    sudo netstat -tapen | grep ":4444 "
    

    Reply was like:

    tcp6       0      0 XXXXXXXXX:4444       :::*                    LISTEN      107        31526       **10479**/java
    

    And to kill the Selenium server process identified (in my case) with 10479

    sudo kill 10479
    
    0 讨论(0)
  • 2021-01-31 03:09

    In OSX if you follow the command from @HaloWebMaster (lsof -i -n -P | grep 4444) the next step is to take the PID (usually a 4 - 5 digit number indicating the process ID) and run the following command:

    kill -9 <PID>

    You shouldn't need sudo unless the process was started by another user or root.

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

    If all the above is not working, please save your work and reboot your system. It will solve the problem

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

    If you get a 403 error on 127.0.01:4444 and not a 404 one, something is running there. (You're positive it cannot be a previous instance Selenium ? It'd be the most logical.)

    Sometimes Selenium continue running in the background after an unexpected exit. I'd suggest checking the running processes, or rebooting the machine if everything else fails.

    It happens to me frequently when Hudson asks Selenium-Server to run some tests and it fails in the middle for some reasons. Killing the process solves the problem.

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