seleniumServerJar does not work on mac
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 (
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, } };
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?
I've already run manually and works! If i start selenium before run protractor it works. It sound some problem in seleniumServerJar.
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/)?
is not relative path to the project directory, is relative path to protractor config file.
Thank you man. @stickel I put the relative path to project directory and it worked.
@vipper I had some issues with paths when I started using Protractor too. Glad it worked! :smile:
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!
The way most projects are set up I think the current way of doing it works quite well.
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)