I am trying to get Nightwatchjs tests running with Chrome, Firefox, IE, Edge, and mobile web browsers (iOS, Android, etc). I'm having difficulty getting Selenium to open up a non-Firefox browser. Currently the tests work for Chrome and Firefox, but it fails when trying for IE or Edge.
On command line:
npm run e2e --env chrome <--- works!
npm run e2e --env firefox <-- works!
npm run e2e --env ie <--- opens up firefox
npm run e2e --env edge <-- opens up firefox
my nightwatch.conf.js:
require('babel-register');
const config = require('../../config');
// http://nightwatchjs.org/getingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
custom_commands_path: [
// 'test/e2e/custom-commands',
'./node_modules/nightwatch-axe/src/commands',
],
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.gecko.driver': require('geckodriver').path,
'webdriver.chrome.driver': require('chromedriver').path,
'webdriver.edge.driver': 'C:\\Users\\zfolwic\\Downloads\\MicrosoftWebDriver.exe',
'webdriver.ie.driver': 'C:\\Users\\zfolwic\\Downloads\\IEDriverServer_x64_3.9.0\\IEDriverServer.exe',
},
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: `http://localhost:${process.env.PORT || config.dev.port}`,
},
},
ie: {
browserName: 'internet explorer',
javascriptEnabled: true,
acceptSslCerts: true,
},
edge: {
desiredCapabilities: {
browerName: 'MicrosoftEdge',
javascriptEnabled: true,
acceptSslCerts: true,
},
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
},
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true,
},
},
},
};
I've changed my IEDriver from 64 to 32 bit with no change in the result. I am running version of EdgeDriver 3.9.0 (32 and 64bit) on Selenium 3 IE is 32 bit browser. Edge is:
Microsoft Edge 40.15063.0.0
Microsoft EdgeHTML 15.15063
I've also tried npm/yarn install/add edgedriver
and re-running for Edge- no dice.
I've also added the appropriate registry key (I think)
EDIT:
After downloading and ensuring the correct version of MicrosoftWebDriver is in my DL folder, and furthermore, deleting the other edgedrivers, I get the following issue:
Running: Page Is Accessible
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at Socket.socketCloseListener (_http_client.js:363:23)
at emitOne (events.js:121:20)
at Socket.emit (events.js:211:7)
at TCP._handle.close [as _onclose] (net.js:554:12) code: 'ECONNRESET' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rei-cedar@5.0.0-0 e2e: `node test/e2e/runner.js "edge"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rei-cedar@5.0.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:
npm ERR! C:\Users\zfolwic.la\AppData\Roaming\npm-cache\_logs\2018-02-
16T18_59_29_222Z-debug.log
EDIT 2: This is still an issue. Switching backslashes to forward slashes didn't work, moving it the edgedriver onto my PATH, moving into my project didn't work. Any permutations thereof don't seem to work. Please Help!