Kode_12 Kode_12 - 1 year ago 201
Javascript Question

Error retrieving a new session from the selenium server

I'm attempting to setup Nightwatch.js for the first time. I'm following the following tutorial: https://github.com/dwyl/learn-nightwatch

Unfortunately I've hit a roadblock, and I'm in need of help resolving it.

Error retrieving a new session from the selenium server.
Connection refused! Is selenium server started?

enter image description here


module.exports = {
"src_folders": [
"test"// Where you are storing your Nightwatch e2e/UAT tests
"output_folder": "./reports", // reports (test outcome) output by nightwatch
"selenium": {
"start_process": true, // tells nightwatch to start/stop the selenium process
"server_path": "./node_modules/nightwatch/bin/selenium.jar",
"host": "",
"port": 4444, // standard selenium port
"cli_args": {
"webdriver.chrome.driver" : "./node_modules/nightwatch/bin/chromedriver"
"test_settings": {
"default": {
"screenshots": {
"enabled": true, // if you want to keep screenshots
"path": './screenshots' // save screenshots here
"globals": {
"waitForConditionTimeout": 5000 // sometimes internet is slow so wait.
"desiredCapabilities": { // use Chrome as the default browser for tests
"browserName": "chrome"
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true // set to false to test progressive enhancement


module.exports = { // addapted from: https://git.io/vodU0
'Guinea Pig Assert Title': function(browser) {
.assert.title('I am a page title - Sauce Labs')

Based on the configuration setup. I kept it as basic as possible. I cannot pinpoint the source where it would suggest another selenium server has started. Any ideas?


enter image description here

Answer Source

The solution involved deleting my instance of Chrome (although it was the most recent version) and simply reinstalling the browser again.

I encourage all facing the same problems to first look at QualiT's response above as it's the more conventional troubleshooting strategy.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download