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.

 

Posted By Tibor Dudjik

Over 4 years of experience working as a freelancer in the fields of Project Management, Manual and Automated Software Testings, Software Development.

    3 Responses to “Solution for Selenium already running on port problem”

  1. 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.

  2. CNA License says:

    nice post. thanks.

  3. Aruna says:

    Hi,

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

    Regards,
    Aruna

Leave a Reply




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>