protractor icon indicating copy to clipboard operation
protractor copied to clipboard

seleniumServerJar does not work on mac

Open vipper opened this issue 13 years ago • 9 comments

Guys,

Im trying use seleniumServerJar option on a mac and the below error is presented.

/Users/damorim/Gitspace/orientacao_pedagogica/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1542 throw error; ^ Error: Server exited with 1 at Error () at ChildProcess.onServerExit (/Users/damorim/Gitspace/orientacao_pedagogica/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:193:11) at ChildProcess.g (events.js:175:14) at ChildProcess.EventEmitter.emit (events.js:98:17) at Process.ChildProcess._handle.onexit (child_process.js:789:12)

Do you have some idea what is going on?

my config file is below: exports.config = {

seleniumServerJar: '../../selenium/selenium-server-standalone-2.35.0.jar', seleniumPort: 4444, chromeDriver: '../../selenium/chromedriver',

capabilities: { 'browserName': 'chrome' }, specs: ['onProtractorRunner.js'],

jasmineNodeOpts: { showColors: true, } };

vipper avatar Sep 26 '13 23:09 vipper

I've run on a mac, so not a mac-specific problem.

Can you start the server manually with java -jar selenium/selenium-server-standalone-2.35.0.jar? Maybe there's something wrong with your server jar?

juliemr avatar Sep 27 '13 01:09 juliemr

I've already run manually and works! If i start selenium before run protractor it works. It sound some problem in seleniumServerJar.

vipper avatar Sep 27 '13 02:09 vipper

Is ../../selenium/selenium-server-standalone-2.35.0.jar the correct path relative to the directory you're running the command (/Users/damorim/Gitspace/orientacao_pedagogica/)?

stickel avatar Sep 27 '13 22:09 stickel

is not relative path to the project directory, is relative path to protractor config file.

vipper avatar Sep 27 '13 23:09 vipper

Thank you man. @stickel I put the relative path to project directory and it worked.

vipper avatar Sep 27 '13 23:09 vipper

@vipper I had some issues with paths when I started using Protractor too. Glad it worked! :smile:

stickel avatar Sep 27 '13 23:09 stickel

Glad it got fixed!

Do you think it would be better to have the path relative to the config file? I'm open to changing this to whatever people think is most intuitive!

juliemr avatar Sep 27 '13 23:09 juliemr

The way most projects are set up I think the current way of doing it works quite well.

stickel avatar Sep 27 '13 23:09 stickel

get up-to-date path using path.relative.

   const path = require(`path`);
   const jar = require(`selenium-server-standalone-jar`);
   
   // somewhere in the protractor config
  'seleniumServerJar':  path.relative(require.resolve(`protractor`), jar.path)

vikikamath avatar Feb 06 '18 03:02 vikikamath