2

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)

enter image description here

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!

  • Be sure that you have the correct WebDriver for your version of Windows. IEDriverServer is for IE and MicrosoftWebDriver is for Edge. – Alan Larimer Feb 16 '18 at 18:23
  • As noted above, I have both indicated. I've toggled back and forth between 32 bit and 64 bit versions to no avail. – Zach Folwick Feb 16 '18 at 18:27
  • WebDriver is made for specific releases (10240, 10586, 14393, 15063, Insiders, 16299) of Windows related to the version of Edge (12, 13, 14, 15, Current Build, 16). – Alan Larimer Feb 16 '18 at 18:30
  • it appears my version is 1703, and as build is 15063.0. I have downloaded the correct webdriver, and my conf.js is pointing to it, however it stubbornly only opens firefox! – Zach Folwick Feb 16 '18 at 18:54
  • Change each double backslashes \\ to a forward slash / as Nightwatch is running in Node.js and uses *nix syntax not Windows. (StackOverflow) – Alan Larimer Feb 16 '18 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.