The connection was denied! Has the Selenium server been launched for Nightwatch on Edge?

I have created a project using vue.js. The project includes a small set of unit tests (jest) and an end-to-end test (night watch).

Unfortunately, when attempting to run the end-to-end test using npm I encountered the following error:

Error retrieving a new session from the selenium server

Connection refused! Is the selenium server started?
{ value:
   { message: 'Unable to create session from org.openqa.selenium.remote.NewSessionPayload@16b328bc\nBuild info: version: \'3.12.0\', revision: \'7c6e0b3\', time: \'2018-05-08T15:15:08.936Z\'\nSystem info: host:
\'SYNERGY02\', ip: \'192.168.1.41\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_181\'\nDriver info: driver.version: unknown',
     error: 'session not created' },
  status: 33 }

I'm at a loss as to what could be causing this issue. It's been holding me up for over a week.

Here is the nightwatch.json configuration file:

Path to Microsoft WebDriver in D:\xxx\test\bin\myedgedriver.exe

Path to Nightwatch configuration file in D:\xxx\test\e2e\nightwatch.conf.js

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

// Nightwatch settings
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.edge.driver": "../bin/MicrosoftWebDriver.exe",
      '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
      }
    },

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

Window version:

1803 (os build 17134.285)

Microsoft Edge WebDriver version:

Release 17134
Version: 6.17134 | Edge version supported: 17.17134 

Microsoft Edge browser version:

Microsoft Edge 42.17134.1.0

Nightwatch version in package.json:

 "nightwatch": "^0.9.12"
"selenium-server": "^3.0.1"

Answer №1

This error message...

An issue occurred while trying to retrieve a new session from the Selenium server.

The connection was refused, indicating that the Selenium server may not be running.
{ value: { message: 'Unable to create session from org.openqa.selenium.remote.NewSessionPayload@16b328bc\nBuild info: version: \'3.12.0\', revision: \'7c6e0b3\', time: \'2018-05-08T15:15:08.936Z\'\nSystem info: host: \'SYNERGY02\', ip: \'192.168.1.41\', os.name: \'Windows 10\', os.arch: \'amd64\', os.version: \'10.0\', java.version: \'1.8.0_181\'\nDriver info: driver.version: unknown', error: 'session not created' }, status: 33 }

...indicates an error occurred while attempting to connect to the Selenium Server.

Reviewing the logs on the Selenium Server could provide more insights into what went wrong.

It appears that there is a discrepancy between the version of Selenium Server specified in your target Test Environment and the actual version mentioned in the error log:

  • You indicated:

    • my nightwatch from package.json ver: "selenium-server": "^3.0.1"
  • However, the error trace log indicates:

    • version: \'3.12.0\' at
      time: \'2018-05-08T15:15:08.936Z\

Solution

  • Ensure that your Test Environment is set up with the correct version of Selenium Server binaries.
  • Prior to running the @Tests, make sure the Selenium Server is running using the following command:

    java -jar <path_to>/selenium-server-standalone-<version>.jar
    
  • If you require native events functionality, include this in the command line with:

    -Dwebdriver.enable.native.events=1
    
  • For more information on additional command line options, run:

    java -jar <path_to>/selenium-server-standalone-<version>.jar -help
    
  • You can also find a similar discussion at:

    • 'Connection refused! Is selenium server started?\n' while running Nightwatch.js tests against Selenium Grid

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having difficulty coming back from a promise catch block

I'm struggling to populate a menu list from my PouchDB database because I am unable to retrieve anything within the promise that is executed after calling get on the db. Below is the code in question: <MenuList> {this.populateSavedClues()} ...

How to efficiently use promises within loops in JavaScript

I recently delved into Javascript and I'm still struggling with how promises work within loops. Currently, I am utilizing repl.it db for my project. Let's say I have an array consisting of keys, and my goal is to query each key in the array to st ...

Setting up webRTC and Express.js to function within the same domain requires proper configuration

Currently, I am in the process of creating a video conferencing website using node.js and express.js rather than apache. However, I am faced with some challenges when deciding on the best approach. The main goal is to have the server deliver the website t ...

The functionality of WebDriver wait is malfunctioning

Upon opening this link , a progress bar appears and the option for Hotels can be seen in the top right corner. Various methods like implicit wait, WebDriverWait, and fluent wait have been attempted to tackle this issue. Furthermore, using element.isDispla ...

Struggling with implementing ExtentX in my Java Ant TestNG project and encountering the following problem

I've encountered an issue while trying to integrate ExtentX into my Java Ant testing project. Specifically, I'm facing an error when attempting to write the results into a MongoDB database: ERROR StatusLogger No log4j2 configuration file found. ...

The response from Moment.js shows the date as "December 31, 1969."

Currently, I am in the process of recreating one of FCC's backend projects: Upon testing my code, I noticed that when I input the following URL: http://localhost:3000/1 The result is as follows: {"unix":"1","natural":"December 31, 1969"} var e ...

Issue with the datepicker not toggling properly in Angular-UI 0.11.0, only opens

I am struggling with implementing 2 datepickers using Angular UI version 0.11.0. Here is my HTML code: <span ng-if="periods.period == 10"> <input type="text" datepicker-popup="dd-MMMM-yyyy" ng-model="cdate.customStartDate" is-open="opened1" ...

Put the browser into offline mode using JavaScript

Currently, I am utilizing selenium for application testing purposes. Although I typically start my browser in the usual manner, there comes a point where I must transition to offline mode. I have come across various sources indicating that switching to off ...

What is the best way to save a scheduled cron reference in a database in order to deactivate it at a later time in a

I have implemented a system using cron to schedule push notifications. The user provides the push notification data and the scheduled time, and I use cron to send the notifications at the specified time. Below is the code snippet showing how I create a cr ...

Encountering Issues with Importing vue-router in Vue.js 3 - What Could be the Problem?

Here are the files I am working with: router.js import VueRouter from 'vue-router' export const router = VueRouter({ routes: [ { ... } ] }) main.js import { createApp } from 'vue' import App from './App.vue ...

Move content off the screen using CSS3 translation

Throughout various projects, I have encountered the need to make elements on a webpage translate out of view (essentially making them fly out of the document). The idea was that by simply adding a class to the element, the CSS would take care of the animat ...

using node.js to save query results as global variables

Help needed! I'm struggling to pass the results of my query statement to a global variable in order to dynamically configure my jsganntimproved chart. Any suggestions on what could be going wrong? In the snippet below, the console.log(taskItem) retur ...

Navigating securely with RemoteWebDriver and Selenium over an encrypted connection

While working with Selenium RemoteWebDriver, I have noticed that all commands are sent to the servlet container in plain text. This hasn't posed a problem for me thus far, but I am worried about sending sensitive test data such as usernames and passwo ...

The autocomplete feature in Codemirror seems to be failing specifically when writing JavaScript code

I am having trouble implementing the autocomplete feature in my JavaScript code editor using Codemirror. Can someone please help me figure out what I'm doing wrong? Here is the snippet of code : var editor = CodeMirror.fromTextArea(myTextarea, { ...

Discovering whether input field is currently in focus using jQuery

Does anyone know how to determine if an input tag in HTML has focus using jQuery? The keydown event will function for forms when input, image, etc. tags have focus. However, it will not work if the focus is on the form itself but not on any specific tags ...

Difficulty arises when Jest tests struggle to interpret basic HTML tags within a React Component

When running test runs, issues arise when using standard HTML tags with Jest. My setup includes Babel, Webpack, Jest, and React Testing Library. To enable jest, I have installed a number of packages: "@babel/plugin-proposal-class-properties": "7.8.3", "@ ...

Unit testing component in Ionic 2 with Ionic's specific markup and elements

Within my Angular 2 component for an Ionic 2 app, I utilize Ionic's markup as shown below: <ion-card> <h3>{{ rawcontent.name }}</h3> <p *ngIf="rawcontent.description">{{ rawcontent.description }}</p> </ion-car ...

Encountering error ORA-12514 when utilizing the node oracle-db npm package

At the moment, I am immersed in a project that relies on utilizing oracle for its backend. Following the instructions provided in this link, I successfully installed node-oracledb on my Mac using npm. The contents of my file are as follows: var oracledb = ...

The eel feature results in no output

During my Python program development using the Eel module, I encountered an issue. The problem is that the eel.getImgSrc(path) function returns null when trying to retrieve image's byte data. Take a look at this example: -----web/main.js------ async ...

"Encountered an issue with locating elements using the driver.find_element

I need assistance in automating the process of clicking on the "Create New Network" button using Selenium. <button type="button" id="dt-refreshBtn" class="btn wc-btn--link" data-label="Create New Network" role=&q ...