nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

can't use port 4444 on macbook #1673

Closed bchenSyd closed 6 years ago

bchenSyd commented 6 years ago

as the title says, I got a 'Could not initialize class org.openqa.selenium.SessionNotCreatedException error when using default port 4444 , but after I change it to a different port, e.g. 12345, everything is fine.

"selenium": {
    "start_process": true,
    "server_path": "../selenium-server/3.7.1-server.jar",
    "log_path": "",
    "port":  4444
    "cli_args": {
      "webdriver.chrome.driver": "../chromedriver/2.33-x64-chromedriver"
    },
  }
Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ value:
   { message: 'Could not initialize class org.openqa.selenium.SessionNotCreatedException',
     error: 'unknown error' },
     status: 13 }

closed! exit code: 1

I'm just curious why I can't use port 4444 on my macbook (I tried to sudo out , but still without luck)

sandeepthukral commented 6 years ago

First, please use the forums for Nightwatch for questions like these. https://groups.google.com/d/forum/nightwatchjs

For answering this question, I have been using NW on OSX for more than a year. I have not had this problem many times. If it does happen, please check if there is any application that is already using this port. If this port is not used, please check the file selenium.log that should register any errors when it was run. If these do not help, please go to the forums and ask for help.