selenium-standalone icon indicating copy to clipboard operation
selenium-standalone copied to clipboard

selenium-standalone start -port 5555 doesn't run on port 5555 but runs on port 4444

Open navinjoy opened this issue 10 years ago • 3 comments

selenium-standalone start -port 5555 doesn't run on port 5555 but runs on port 4444.

navinjoy avatar Jul 13 '16 23:07 navinjoy

Since -port is an argument for the selenium process itself (not this wrapper), it needs to be added after the -- argument.

$ ./bin/selenium-standalone start -- -port 5555
09:40:00.550 INFO - Launching a standalone Selenium Server
...
09:40:00.709 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
09:40:00.709 INFO - Selenium Server is up and running
Selenium started

@navinjoy Can you give that a try and let me know if it works for you?

stephenash avatar Jul 14 '16 16:07 stephenash

@stephenash thank you... that worked 👍 and how can I use it in selenium-standalone.start([opts], cb) function. Tried the below one but that's not working.

            selenium_standalone.start({port:5555},function(err, child) {
                if (err) {
                    grunt.log.error(err);
                    return;
                }
                process.on("exit", function() {
                    child.kill();
                });
            });

navinjoy avatar Jul 14 '16 17:07 navinjoy

You need to pass it to seleniumArgs: {port}, see https://github.com/vvo/selenium-standalone#seleniumstartopts-cb

vvo avatar Jul 15 '16 08:07 vvo