When running selenium server often it happens that it can’t start with the following error:

“Selenium is already running on port 4444. Or some other service is.”

This happens because Selenium uses the 4444 port as its default and if you already started selenium or some other application is using that port Selenium will be prevented from using the same port.

There are several ways around this problem:

  • Find the application that is blocking/using the 4444 port and turn it off or change its port. Using the command “netstat -ano” (under Linux use “netstat –tcp –listening –programs”) from command prompt identify the applications PID and then look it up in task manager. If you don’t see the PID in task manager make sure to turn the column on in View->Select Columns:
    Once you have identified the application either kill it or change its port. Now its safe to run “java -jar selenium-server.jar” and Selenium will start up correctly.
  • Change the port Selenium is using. Run “java -jar selenium-server.jar -port XXXX” where XXXX is the desired unused port for example “java -jar selenium-server.jar -port 4448”.
    This fix is also useful if you want several instances of the selenium server running on the same machine.

 

Similar Posts from the author:

5 thoughts to “Solution for Selenium already running on port problem

  • educational grants

    I’ve recently started a blog, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.

  • CNA License

    nice post. thanks.

  • Aruna

    Hi,

    I am still facing issues. I use Selenium RC, TestNG and Java. Any other options to chnage the port?

    Regards,
    Aruna

  • Linwood Duff

    Good day! I just would like to give you a big thumbs up for the great info you’ve got here on this post. I’ll be returning to your site for more soon.

  • Prashant

    This server problem is mostly faced by all selenium users. It shows port error and can’t be accessed by the remote system.Recently I came across a testing tool that can be executed from remote server even if it not installed in remote server.

Comments are closed.