Nightwatch chromedriver error

+1 vote

Unable to run nightwatch tests on chrome.

Below is the modified nightwatch.json that I downloaded from nightwatch example:

{
  "src_folders" : ["./examples/tests"],
  "output_folder" : "./examples/reports",
  "custom_commands_path" : "./examples/custom-commands",
  "custom_assertions_path" : "",
  "globals_path" : "./examples/globals.json",
  "live_output" : false,

  "selenium" : {
    "start_process" : false,
    "server_path" : "/lib/sel-serv.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
      "webdriver.chrome.driver" : "/lib/chromedriver/chromedriver.exe",
      "webdriver.ie.driver" : "",
      "webdriver.firefox.profile" : ""
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_host" : "127.0.0.1",
      "selenium_port" : 4444,
      "silent" : true,
      "disable_colors": false,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "chrome":{
      "desiredCapabilities" : {
        "browserName" : "chrome",
        "javascriptEnabled" : true,
        "acceptSslCerts" : true
      }
      }
    },

      "desiredCapabilities": {
        "name" : "test-example",
        "browserName": "chrome"
      },
      "globals" : {
        "myGlobal" : "some_sauce_global"
      },
      "selenium" : {
        "start_process" : false
      }
  }
}

The error I get is this:

ERROR There was an error while starting the test runner:

Error: Invalid testing environment specified: chrome
    at Object.CliRunner.parseTestSettings (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:448:15)
    at Object.CliRunner.init (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:49:8)
    at module.exports.runner.runner (/usr/local/lib/node_modules/nightwatch/lib/index.js:546:17)
    at /usr/local/lib/node_modules/nightwatch/bin/runner.js:9:16
    at module.exports.cli.cli (/usr/local/lib/node_modules/nightwatch/lib/index.js:504:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/nightwatch/bin/runner.js:8:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

I also found an older post which says you have to create new file in root directory so give it a try and nothing happened

Mar 25, 2018 in Selenium by Shubham
• 13,290 points
438 views

1 answer to this question.

0 votes

You should use a dot before lib:

"webdriver.chrome.driver" : "./lib/chromedriver/chromedriver.exe",

and also in the selenium.jar:

"server_path" : "./lib/sel-serv.jar",
answered Mar 25, 2018 by nsv999
• 5,090 points

Related Questions In Selenium

0 votes
2 answers

Getting Error in System.setProperty of ChromeDriver

System.setProperty("webdriver.chrome.driver", ...READ MORE

answered Jan 8 in Selenium by anonymous
2,148 views
+1 vote
1 answer
0 votes
0 answers

I'm Getting error as soon as I Initialize driver = new ChromeDriver();

below is my code. package com.salesforce.pageobject; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import ...READ MORE

Aug 22 in Selenium by Prajwal Wakekar
44 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
562 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
894 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
558 views
0 votes
1 answer

Headless ChromeDriver using Python Selenium error: Fails To Start— “DevTools request failed”

This should be because your ChromeDriver is ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,090 points
343 views
0 votes
1 answer

TestNG error:- Cannot find class in classpath

The issue is because the project directory ...READ MORE

answered Mar 23, 2018 in Selenium by nsv999
• 5,090 points
6,884 views