SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.48k stars 8.15k forks source link

nightwatch+phantomjs do not running #5750

Closed Cuna closed 6 years ago

Cuna commented 6 years ago

Meta -

OS: Windows 10 Selenium Version: 3.11.0 Browser: phantomjs-prebuilt Browser Version: 2.1.14

Expected Behavior -

nightwatch.conf.js

`require('babel-register') var config = require('../../config')

// http://nightwatchjs.org/gettingstarted#settings-file module.exports = { src_folders: ['test/e2e/specs'], output_folder: 'test/e2e/reports', custom_assertions_path: ['test/e2e/custom-assertions'], selenium: { start_process: true, server_path: require('selenium-server').path, host: '127.0.0.1', port: 4444, cli_args: { 'webdriver.chrome.driver': require('chromedriver').path } },

test_settings: { default: { selenium_port: 4444, selenium_host: 'localhost', silent: true, globals: { devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) } },

chrome: {
  desiredCapabilities: {
    browserName: 'chrome',
    javascriptEnabled: true,
    acceptSslCerts: true,
    chromeOptions:{
      args:['--headless']
    }
  }
},

firefox: {
  desiredCapabilities: {
    browserName: 'firefox',
    javascriptEnabled: true,
    acceptSslCerts: true
  }
},

phantom: {
  desiredCapabilities: {
    browserName: "phantomjs",
    javascriptEnabled: true,
    acceptSslCerts: true,
    "phantomjs.binary.path": require("phantomjs-prebuilt").path        
    // "phantomjs.cli.args": ["--webdriver=4444"],//--ignore-ssl-errors=true
    // "phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
  }
}

} } `

Actual Behavior -

my-project@1.0.0 e2e E:\JavaTest\my-project node test/e2e/runner.js

Starting selenium server... started - PID: 2752

[Test] Test Suite

Running: default e2e tests

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started? { value: { message: 'Unable to create session from org.openqa.selenium.remote.NewSessionPayload@34df0cf9\nBuild info: version: \'3.11.0\', revision: \'e59cfb3\', time: \ '2018-03-11T20:33:15.31Z\'\nSystem info: host: \'IC-CHENWZ\', ip: \'10.52.4.76\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_161\'\nDriver info: driver.version: unknown', error: 'session not created' }, status: 33 }

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! my-project@1.0.0 e2e: node test/e2e/runner.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the my-project@1.0.0 e2e script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

p0deje commented 6 years ago

I'd recommend asking for a help using Nightwatch support channels first - it looks like a configuration issue (http://nightwatchjs.org/contact). Should you find that this is some problem with Selenium itself, I'll re-open this issue.