Question

I am trying to run protractor using grunt on RHEL 6.5 box. I verified it has firefox to run the test.

Selenium server is installed using "webdriver-manager update". Other install information :

Node v0.11.12
grunt-cli v0.1.13
grunt v0.4.4
protractor 0.21.0
grunt-protractor-runner 0.2.4

My protractor config file:

exports.config = {

  seleniumAddress: 'http://localhost:4444/wd/hub',

  capabilities: {
    'browserName': 'firefox'
  },

  specs: ['/test/example-spec.js'],

  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 20000
  },

  allScriptsTimeout: 20000

};

Running the script from Jenkins or manually using grunt fails with error:

Running "protractor:e2e" (protractor) task
util.puts: Use console.log instead
Using the selenium server at http://localhost:4444/wd/hub
>>
Fatal error: protractor exited with code: null

I could see "webdriver-manager start" is able to start the selenium server on port 4444. I am not able to find any logs for that. Am I missing anything here ?

Edit: There are no errors in grunt, checked with --verbose for grunt. It looks like protractor plugin is failing somewhere. I will dig more into it.

Was it helpful?

Solution

I found the problem with firefox, basically my protractor config was not using any webdriver server setting but was using the default server, this way was quite handy since did not have start selenium by my self

In order to fix this issue I am starting selenium server by myself spesifiying firefox and chrome drivers

java -jar "C:\Users\%USERNAME%\AppData\Roaming\npm\node_modules\protractor\selenium\selenium-server-standalone-2.42.1.jar" -Dwebdriver.chrome.driver="C:\Users\%USERNAME%\AppData\Roaming\npm\node_modules\protractor\selenium\chromedriver.exe" -Dwebdriver.firefox.bin="C:\Users\%USERNAME%\AppData\Local\Mozilla Firefox\firefox.exe"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top